Skip Navigation

[Resolved] Conditional Statement trouble with checklist custom fields

This support ticket is created 4 years, 4 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by rickM-8 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#2023805
Image 3.png
Image 2.png
Image 1.png

I am trying to: Create a conditional content area (within a custom template)

Link to a page where the issue can be seen: hidden link --> Please note the text "2 piecesasdfasdasdasdasdasd" appears at the bottom even though the condition is NOT met.

I expected to see: Nothing. If the condition were not met, I would expect the text to be hidden

Instead, I got: The text: 2 piecesasdfasdasdasdasdasd

Image 1: Custom field configuration
Image 2: Condition created in template
Image 3: Post settings

#2024153

Hello and thank you for contacting the Toolset support.

I analyzed this a bit and I was able to detect two issues. The first one is that you activated NOT on the condition, which means that the condition is met. Check this screenshot hidden link
The value is 2, does not equal 3, which gives false. Then the NOT operator returns true. The block will be displayed.

I tried another block to check for value 2, then, I realized that you have chosen to store 0 when an option is not checked for the field, check this screenshot hidden link
I changed this option, and I saved the post again and tried a new conditional block to display only for toilets that have Pieces=2 and it worked as expected.

Please check again from your side. Save the post again to remove 0s for unchecked options, and let me know if a conditional block is not working as expected.

#2026105

Thank you. We tried a few configurations but this makes sense and will help us better use toolset in the future. Have a great week!