Skip Navigation

[Resolved] How to check what for to compare a fields value in HTML conditions

This thread is resolved. Here is a description of the problem and solution.

Problem:
How can I find out what my field outputs when it's used in HTML Conditionals?
I do not know what value to compare my custom fields to precisely.

Solution:
The best trick here is to insert the actual field in the loop (wpcf-my-field) so you see on the front end what it outputs in the single cases.

Then, you just use those values in your HTML conditions.

This support ticket is created 5 years, 2 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by aldoR 5 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#1203241
Schermata-2.jpg
Schermata-2019-02-20-alle-16.16.26.jpg

I try to fix this problem, apparently simple to do but I can't solve.

In output page of menus (example this: hidden link) at bottom I should see a legend of symbols when one or more symbols are selected in list of Piatti (related post type in menu)

the view for this "legend" is a conditional output: [wpv-conditional if="( $(wpcf-prodotto-congelato).id(menu) eq '1' )"]<img src="hidden link" width="28" height="28" class="alignnone size-full" />Piatti che potrebbero contenere uno più ingredienti surgelati/congelati all’origine[/wpv-conditional]

and works fine, but if in menu there are more than 1 "icon" in the legend appears multiple icons (see screenshot)

if in view setting i put limit offset (show only 1 item) the result page dont'show nothing (see second screenshot)

how can I solve this setting?

thanks in advance
Aldo

#1203595

You can only check upon real values saved in the field wpcf-prodotto-congelato.
What does the field wpcf-prodotto-congelato save?
Numbers like 1, 2 or other values?

I am not sure, but it seems it saves strings, that could be "1" or even "1, 2, 3, "?

The best trick here is to insert the actual field in the loop (wpcf-prodotto-congelato ID "menu") so you see on the front end what it outputs in the single cases.
Then, you just use those values in your conditions.

#1205425

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.