documentation

You can also use not to check for values that evaluate to false: 1 2 3 {% if not user.subscribed %}

You are not subscribed to our mailing list.

{% endif %} For multiple conditions, and and or can be used: 1 2 3 {% if temperature > 18 and temperature < 27 %}

It's a nice day for a walk in the park.

{% endif %} For multiple branches elseif and else can be used like in PHP. You can use more complex expressions there too: 1 2 3 4 5 6 7 {% if product.stock > 10 %} Available {% elseif product.stock > 0 %} Only {{ product.stock }} left! {% else %} Sold-out! {% endif %}