Skip Navigation

[Resolved] Fallback picture

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years ago.

Assisted by: Christian Cox.

Author
Posts
#1375043

Hello,

On Toolset View, I would like to be able to display a default picture when the user did not upload a picture on the CRED Form.

Basically, If I use this on Toolset View "[wpv-user field="uploaded-picutre-on-the-cred-form"]" but the field "uploaded-picutre-on-the-cred-form" is not filled by the user, I would like to be able to display "example.png" as default picture.

Thank you in advance for your help.
Best regards,
Damien

#1375183

Hi, you can use conditional HTML to test the value of a custom image field on the current User profile in the loop, and display something depending on that value. In the conditional clause it is important to use the "raw" output type, and not include any custom size information. Here is a working example using a User profile custom image field with the slug user-image-1:

[wpv-conditional if="('[types usermeta="user-image-1" output="raw"][/types]' ne '' )"]
The field is not empty, so display the image here.<br />
[types usermeta='user-image-1' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional'][/types]
[/wpv-conditional]
[wpv-conditional if="('[types usermeta="user-image-1" output="raw"][/types]' eq '' )"]
The field is empty, so display the fallback image here.<br />
<img src="/path/to/file/image.jpg" />
[/wpv-conditional]

Let me know if you have questions about this.