Skip Navigation

[Resolved] Conditional Display with a less than symbol < causes it not to work

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

Problem:
The user was having issues with a conditional block where he check with the < operator. Solution:
Prefer to use letter-based operator instead of symbol-based operators:

  • gte for >=
  • gt for >
  • lte for <=
  • lt for <
This support ticket is created 4 years, 5 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 philipF-5 4 years, 5 months ago.

Assisted by: Jamal.

Author
Posts
#1851585
Screenshot 2020-11-20 215942.png

Setting up a conditional display with a number field named number of pages. Using the fields and text block I insert the conditional statement like this
~~~~
[wpv-conditional if=" ( ( $(wpcf-number-of-pages) <= '250' ) ) " ] Some random text [/wpv-conditional]
~~~~
Now if I have a piece of content that the number of pages is equal to or less than 250 it should show that random text, but instead it just is blank in the front end, the code looks like it is not parsing correctly in the fields and text block (see image 1).

It is parsing the first conditional correctly with the equal or greater than (>=) symbol, but not when it is less than (<) or equal or less than (<=).

Is there anyway that I can make this work?

#1851707

Hello and thank you for contacting the Toolset support.

Our developers are already aware of some cases where the greater and lower symbols cause issues inside a block-based view or content template. Can you try to use text instead of symbols and let us know if it works for you?
- gte for >=
- lte for <=

[wpv-conditional if=" ( ( $(wpcf-number-of-pages) lte '250' ) ) " ] Some random text [/wpv-conditional]
#1851949

My issue is resolved now. Thank you!