Skip Navigation

[Resolved] I need to show an icon based on checkbox selection

This support ticket is created 5 years, 8 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.

Our next available supporter will start replying to tickets in about 0.61 hours from now. Thank you for your understanding.

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)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1215355
Schermata 2019-03-18 alle 10.31.44.png

In a view i need to show some icons related to a checkbox selection in a custom field
I've putted this conditional output in a view but in frontend I see the icon in every post (even if not selected)

[wpv-conditional if="( $(wpcf-icone) eq '1' )"]<img src="hidden link" width="40" height="40" class="alignleft size-full" />[/wpv-conditional]

the setting of checkbox field is on screenshot

#1216628

Hi, we recommend you do not choose "Save 0 to the database" for checkbox fields. This setting can produce some confusing results, so we recommend you choose "Save nothing" instead. See the post here for more information about this:
https://toolset.com/errata/checkboxes-that-save-0-are-interpreted-as-checked-by-views/

Once you have changed the setting for this custom field, you should resave all the posts that use this checkboxes group. This will update the saved values correctly, then you can use conditionals to test the checkbox values.