--- title: "Tags" slug: "liquid-tags-tags" description: "Covers Liquid tags in Insider One templates, including conditional logic, loops, variable assignment, capture, counters, comments, and raw content blocks." updated: 2026-03-24T13:29:21Z published: 2026-03-24T13:29:21Z canonical: "academy.insiderone.com/liquid-tags-tags" --- > ## Documentation Index > Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt > Use this file to discover all available pages before exploring further. # Tags Tags are the structural and logical building blocks of a Liquid template. Denoted by {% %} delimiters, they govern control flow, iteration, and variable assignment, but unlike output blocks, they render no content to the page themselves. ## if / elsif / else / endif ```plaintext {% if condition %} ... {% elsif other_condition %} ... {% else %} ... {% endif %} ``` Every if must be closed with {% endif %}. ```plaintext {% if c_loyalty_tier == "gold" %} Gold member offer: free shipping on all orders. {% elsif c_loyalty_tier == "silver" %} Silver member offer: free shipping over 500 TL. {% else %} Standard shipping rates apply. {% endif %} ``` ## unless The opposite of if. It runs when the condition is false. ```plaintext {% unless c_loyalty_tier == blank %} Welcome back, {{ c_loyalty_tier }} member! {% endunless %} ``` This is equivalent to {% if c_loyalty_tier != blank %}. You cannot use elsif with unless. ## case / when You can match a single value against multiple options. ```plaintext {% case c_loyalty_tier %} {% when "bronze" %} Welcome to our loyalty program! {% when "silver" %} Welcome, Silver member! {% when "gold" %} Welcome, Gold member — your exclusive benefits are active. {% else %} Join our loyalty program to start earning rewards. {% endcase %} ``` You can match multiple values in one when using commas. ```plaintext {% case language %} {% when "tr", "az" %} Merhaba! {% when "en", "au", "nz" %} Hello! {% else %} Hi! {% endcase %} ``` The or keyword is not supported inside when. You can use commas instead. ## for You can loop over a list or a number range. ```plaintext {% for item in items %} {{ item }} {% endfor %} ``` **Number range** ```plaintext {% for i in (1..5) %} {{ i }} {% endfor %} → 1 2 3 4 5 ``` **limit****,** **offset****,** **reversed** ```plaintext {% for item in items limit: 3 %}...{% endfor %} {% for item in items offset: 2 %}...{% endfor %} {% for item in items limit: 3 offset: 2 %}...{% endfor %} {% for item in items reversed %}...{% endfor %} ``` **break** **and** **continue** ```plaintext {% for item in items %} {% if item == "skip_me" %}{% continue %}{% endif %} {% if item == "stop_here" %}{% break %}{% endif %} {{ item }} {% endfor %} ``` ### forloop variables | Variable | Description | | --- | --- | | forloop.index | Current position, starting from **1** | | forloop.index0 | Current position, starting from **0** | | forloop.first | *true* on the first iteration | | forloop.last | *true* on the last iteration | | forloop.length | Total number of iterations | ```plaintext {% for item in items %} {% if forloop.first %}