unless

Render an HTML block conditionally only when a specified expression evaluates to false or nil.

Syntax

{% unless condition %} ... {% endunless %}

Example

{% assign is_closed = false %}{% unless is_closed %}Open Today{% endunless %}

Output

Open Today

The unless tag functions as the logical inverse of if, executing its inner markup only when the condition evaluates to false or nil. It keeps templates clean without requiring awkward negation operators.

In keyword templates, unless displays standard guarantees when restriction flags are absent. For example: {% unless row.is_restricted %}<p>Standard same-day appointments available.</p>{% endunless %}. If the CSV row lacks the restriction flag, the guarantee renders naturally, keeping content relevant for local search visitors.

Try this syntax in the editor.