I have been struggling with this for some time. Trying to display a profile image and if no image display some text. I have it displaying the image properly but when i use the if to display something else if it is empty i don't get what is expected.
For the case of this example I have the following.
If a profile image exists type "happy" if it does not type "grumpy"
Here is the code as I understand it from the documentation:
wpcf-user_profile_image is the custom field that i created. I have added the wpcf- as outlined because this is a custom value created by types.
When i use my custom value on the page the image value works fine
[types usermeta="user_profile_image" size="thumbnail" align="none" resize="proportional"][/types]
When i try to use it in an if statement it doesn't seem to work?
[wpv-if f1="wpcf-user_profile_image" evaluate="empty($f1)"]grump[/wpv-if]
[wpv-if f1="wpcf-user_profile_image" evaluate="empty($f1)" condition="false" ]happy[/wpv-if]
So when i execute i get all records showing as grumpy when i know that the fields user_profile_image is propagated.
So needless to say i am stuck on the conditional statement.
Any help or guidance would be much appreciated pulling my hair out. It is a private site so to view the live page please msg me.
Thanks much!
I have added a screen capture to see the result i am getting. I should have all "happy" and only one record that is "grumpy"
Thanks again
Hi rogerw,
You are checking a custom user field, in this case please try this:
[wpv-if evaluate="'[types usermeta="user_profile_image" size="thumbnail" url="true"][/types]' = ''" debug="true"]grump[/wpv-if]
[wpv-if evaluate="'[types usermeta="user_profile_image" size="thumbnail" url="true"][/types]' = ''" condition="false" debug="true"]happy[/wpv-if]
Thank you sorry I missed the reply. I will review your suggestions and let this close if the issue is corrected.
Please let me know if you need more assistance for it