Skip Navigation

[Resolved] alternate image

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by opadipeO 1 year, 10 months ago.

Assisted by: Minesh.

Author
Posts
#2529085

Hello,
I want to add an alt or default image that displays if my users did not upload image. Once they upload the image the default image will be automatically changed to the one they uploaded.
Take a look at how i coded it

<div class="row">
<div class="form-group col-md-6">
<label for="%%FORM_ID%%_upload-art"><img src="hidden link" alt="hidden link">[cred_i18n name='upload-art-label'][/cred_i18n]</label>
[cred_field field='upload-art' force_type='field' output='bootstrap' previewsize='thumbnail']
</div>

What I want is that I want a default image that displays incase the user did not upload image and once the user upload image the default image will be replaced with the image uploaded.

Thanks

#2530143

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Actually - this can be achieved two way.

When you are trying to display the image field - we will check that if image is available or not, if image is not uploaded and not available then we will display the default image otherwise the uploaded image. Please check the following related ticket:
=> https://toolset.com/forums/topic/set-default-image-to-content-template-loop/#post-1259345

Another way is to check on server side that when you will submit the form we will check on server side that image is uploaded or not, if no image is uplaoded then we will set the default image using the Toolset form hook: cred_save_data

Please check the following related ticket that might help you:
- https://toolset.com/forums/topic/using-default-image-if-user-submits-form-without-image/#post-625849

Please let me know if you need further assistance.

#2530807

My issue is resolved now. Thank you!