Skip Navigation

[Resolved] Conditionnal output doesn't work

This support ticket is created 4 years, 10 months 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.

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)

This topic contains 2 replies, has 2 voices.

Last updated by ericK-4 4 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1540947

Hi
For a directory site of advocate, some profile give their photo and other don't
If there's no photo a avatar take place so I make a conditionnal like that :
[wpv-conditional if="( $(wpcf-photo) eq '' )"][types field='photo' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional' item='@coordonnees.parent'][/types]
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-photo) eq '' )" evaluate="false"]<img style="width:120px; height:120px;" src="hidden link">
[/wpv-conditional]
[types field='prenom' item='@coordonnees.parent'][/types]
And the ‘photo' field is a parent of 'coordonnees'
And it doesn't work

A link a for example :
hidden link

Thanks for your support
Eric

#1541253

Hello, for one thing you are displaying the avatar in the wrong conditional. It should be in the eq '' conditional, not the evaluate="false" conditional. If you place the shortcode outside the conditional, does it work by itself?

[types field='photo' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional' item='@coordonnees.parent'][/types]

If so, then you can use the Types field shortcode directly in your conditional, like this:

[wpv-conditional if="( '[types field="photo" output="raw" item="@coordonnees.parent"][/types]' eq '' )" evaluate="false"]
[types field='photo' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional' item='@coordonnees.parent'][/types]

[wpv-conditional if="( '[types field="photo" output="raw" item="@coordonnees.parent"][/types]' eq '' )"]
<img style="width:120px; height:120px;" src="<em><u>hidden link</u></em>">
[/wpv-conditional]
#1541739

My issue is resolved now. Thank you!