We are trying to change the output from a checkboxes custom field from the data associated with the selected option to display a specific image instead.
Our field is called Partner Awards. It has two checkbox options, 2021 Award Recipient and 2022 Award Recipient. We want each option to have its own image. So if 2021 Award Recipient is checked, then this field will output the image for 2021. If 2022 Award Recipient is checked, then this field will output the image for 2022. If both options are checked then the output should show both images.
A page where you can see our attempt to do this is at the bottom here:
hidden link
The content template is located here:
hidden link
We want this field set up to conditionally display if it is not empty. That way nothing will display if neither of the options are checked. I set up a conditional the way you showed me to do it working for another client, but it's not working. If you view the page here,
hidden link
you can see Partner Awards: showing with nothing listed below it. That header would not display at all if the conditional was working. So I did something wrong there too. Let me know if I need to separate these into two different support threads.
During troubleshooting, I noticed that the conditional check was evaluating for an empty value:
[wpv-conditional if="($(wpcf-partner-awards) ne '')"]
....
[/wpv-conditional]
But the 'Partner Awards' is set to save '0' when unchecked, in the field's settings, so this field output will not be empty. To fix this, I've changed the condition to check for the value '0' instead:
[wpv-conditional if="($(wpcf-partner-awards) ne '0')"]
....
[/wpv-conditional]
As a result, the heading doesn't display, when none of the checkboxes are checked.