Tags reference

Tags make up the programming logic of a theme. They are wrapped in {% %} delimiters and, unlike output tags, do not print anything to the page on their own. This page covers the theme-specific tags, the EasyStore-specific tags, and the standard Liquid control-flow tags available in EasyStore themes.

Theme tags

Tags used to structure a theme's sections and settings.

schema

Defines the settings, blocks, and presets of a section as a JSON object. The {% schema %} / {% endschema %} block is read by the theme editor and must appear once per section file. See Sections for the full schema format.

{% schema %}
{
  "name": "Featured collection",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Heading"
    }
  ]
}
{% endschema %}
			

section

Renders a section file from the sections folder by name. Used inside layout files to place sections such as the header and footer.

{% section 'header' %}
{% section 'footer' %}
			

EasyStore-specific tags

Tags unique to EasyStore themes.

app_snippet

Injects content from installed apps at a named insertion point. Place these tags at the locations in your theme where apps are allowed to add their own markup (for example tracking scripts, review widgets, or upsell blocks). Each point is addressed as area/position.

Common insertion points include global/head, global/body_start, global/body_end, collection/product_top, product/content_bottom, and account/content_bottom.

{% app_snippet 'global/head' %}
{% app_snippet 'global/body_start' %}
{% app_snippet 'collection/product_top' %}
{% app_snippet 'account/content_bottom' %}
			

csrf

Outputs the CSRF token for the current session. Every storefront <form> that submits with the POST method must include this token as a hidden _token field, otherwise the request is rejected.

<form action="/cart" method="post" id="cart-form">
  <input type="hidden" name="_token" value="{% csrf %}">
  ...
</form>
			

Control flow and variables

Standard Liquid tags for conditionals, loops, and assigning variables.

if / elsif / else / endif

Renders a block of content only when a condition is met. Add elsif for additional conditions and else for a fallback.

{% if product.available %}
  In stock
{% elsif product.tags contains 'coming-soon' %}
  Coming soon
{% else %}
  Sold out
{% endif %}
			

unless

The opposite of if: renders the block only when the condition is false.

{% unless shop.description == '' %}
  {{ shop.description }}
{% endunless %}
			

case / when

Compares a value against several possible matches and renders the block for the first one that matches.

{% case icon %}
  {% when 'icon-caret' %}
    ...
  {% when 'icon-close' %}
    ...
{% endcase %}
			

for / endfor

Iterates over an array. Inside the loop, the forloop object exposes helpers such as forloop.index, forloop.first, and forloop.last.

{% for product in collection.products %}
  {{ forloop.index }}: {{ product.title }}
{% endfor %}
			

assign

Creates a new variable or reassigns an existing one.

{% assign active_count = active_count | plus: 1 %}
			

capture

Captures the rendered content between its tags into a string variable instead of printing it.

{% capture shareTitle %}{{ shop.name | url_param_escape }}{% endcapture %}
			

comment

Prevents the content between its tags from being rendered. Use it to leave notes in your Liquid.

{% comment %}This will not be rendered{% endcomment %}
			

include

Renders a snippet from the snippets folder. Pass named parameters to make values available inside the snippet, or use with to pass a single value.

{% include 'product-card', show_secondary_image: section_settings.show_secondary_image, image_ratio: section_settings.image_ratio %}
			
icon-accounticon-add-newicon-add-storeicon-appicon-appleicon-archiveicon-arrowdownicon-ascicon-bookicon-cancelicon-cart-addonicon-checkouticon-cherryicon-collectionicon-comfirmicon-confirmicon-couponicon-creditsicon-currencyicon-dashboardicon-discounticon-disintegrateicon-domainicon-dscicon-duplicateicon-editicon-emailicon-exclamation-triangleicon-exporticon-eyeicon-eye-slashicon-fullscreenicon-fullscreen-closeicon-generalicon-gifticon-gridicon-hddicon-helpicon-importicon-infoicon-integrationicon-invoiceicon-likeicon-listicon-locationicon-logouticon-new-tabicon-not-secureicon-optionicon-ordericon-outline-arrowdownicon-pageicon-paymenticon-plusicon-posicon-pricingicon-printericon-producticon-product-sumicon-product-sum-xicon-redirecticon-reporticon-reseticon-searchicon-secureicon-settingicon-shippingicon-staricon-storeicon-switch-storeicon-tagicon-taxesicon-templateicon-themeicon-tickicon-trashicon-unarchiveicon-uploadicon-user-tagicon-usersicon-weighticon-wholesale