I am trying to:
Display a default image if the user hasn't uploaded their own image.
I have followed support forum entries where '' should mean 'empty' but doesnt seem to work with images.
The below always returns the second one, meaning empty, when they are not. I've tried 'ne' instead and swapping them around. Basically I cannot test if an image is present or not, returns TRUE always for: eq '', even when there is an image.
[wpv-conditional if="( $(wpcf-image-gallery) ne '' )" ]
<div class=" bvimage_gallery_card hasimage" >
<img src="[types field='image-gallery' size='medium' url='true' resize='crop' separator=' ' id='$business-venues'][/types]"/>
</div>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-image-gallery) eq '' )" ]
<div class="bvimage_gallery_card noimage" ><img src="/noimage.png" /></div>
[/wpv-conditional]
Please use the GUI "Conditional Display" to create Conditions.
This will create it correctly.
As example, if I have a Types Image Field, and upload an Image to it, this code below will show it:
[wpv-conditional if="( $(wpcf-image) ne '' )"]
[types field='image' size='full' align='none'][/types]
[/wpv-conditional]
This Code above will NOT show the image if there is none, and similarly I can then output a placeholder in the case no image exists:
[wpv-conditional if="( $(wpcf-image) eq '' )"]
PLACEHOLDER
[/wpv-conditional]
This works fine, I tested this locally.
Can you try again by using the GUI?