For hubl developers, it would help enormously to enable multiple AND/OR conditions in one single IF statement line.
For example…
{% if var == “this”
&&
“that” %} Var is this and that {% endif %}
{% if var == “this”
||
“that” %} Var is this or that {% endif %}
Currently that I am aware of, the only solutions are to nest multiple statements for AND or set another control variable with multiple statements for OR.
These are both messy for code control, especially for more than two conditions where potentially one line of code is 10+ hubl lines.
{# Current solution for AND conditions #}
{% if var == “this” %}
{% if var == “that” %}
Var is this and that
{% endif %}
{% endif %}
{# Current solution for OR conditions #}
{% if var == “this” %}
{% set or_test = true %}
{% elif var == “that” %}
{% set or_test = true %}
{% endif %}
{% if or_test == true %} Var is this or that {% endif %}
To make this most valuable would be to include “combining operators” and “group logic” too.
Combining operators…
{% if var_x == “this”
&&
var_y == “that” %}
Group logic…
{% if var == ( “this”
&&
“that” )
||
“then” %}