else

Specify a default fallback block to render when all preceding if, elsif, unless, or case conditions are unmet.

Syntax

{% if condition %} ... {% else %} ... {% endif %}

Example

{% assign count = 0 %}{% if count > 0 %}Items Available{% else %}No Items Found{% endif %}

Output

No Items Found

The else tag defines the default fallback branch inside an if, unless, or case construct. It executes only when preceding conditions evaluate to false or nil, guaranteeing that an informative fallback appears.

In keyword templates, else prevents thin content penalties from missing CSV attributes. For example, when displaying contact options: {% if row.phone %}<a href="tel:{{ row.phone }}">{{ row.phone }}</a>{% else %}<span>Online inquiry only</span>{% endif %}. This maintains high content quality across generated pages.

Try this syntax in the editor.