Skip to main content

else

Allows you to specify a default expression to execute when no other condition is met.

You can use the else tag with the following tags:

Syntax

{% else %}
expression
expression

The expression to render if no other condition is met.

{% if product.available %}
This product is available!
{% else %}
This product is sold out!
{% endif %}

Output

This product is available!
Was this page helpful?