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
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.