Compares whether a condition is valid or not and stops or continues output. Without any value or condition the content of FIELDNAME is tested for empty,false,zero or negative.
Parameters
- FIELDNAME - Name of a field in your database
- value (optional) - An integer or string value
- cond (optional) - The condition to test for
Valid conditions are
- eq (default) - Fieldcontent is equal value
- ne - Fieldcontent is not equal value
- lt - Fieldcontent is lower than value
- gt - Fieldcontent is greater than value
- le - Fieldcontent is lower or equal value
- ge - Fieldcontent is greater or equal value
Example
{joodb ifis|price|100|ge}
- This item is rather expensive
{joodb else}
- The price is less than 100 $
{joodb endif}
Compares whether the value of the field price is more then 100 $ ...
Since version 3.9.9pro you are able to compare multiple values and use conditions like "&&" and "||".
This feature is still experimental!
Example
{joodb ifis|price|10|lt || special_price && print_price_info}
- This price is lower as 10$ OR it's a special price AND we can output the price info!
{joodb endif}
Instead of "&&" or "||" you can use "and" and "or"
Notes
- {joodb ifnot} is deprecated. Use ifis with the "ne" condition.
- If value is a string, ifis is testing the alphabethical order.