Liquid Basics

Liquid code is made up of objects, tags and filters.

For a full reference of the Liquid templating language, refer to the official Liquid Reference

Objects

Objects are variables in Liquid and are outputed by being surrounded by double curly braces: {{ and }}.

Input

{{ product.title }}

Output

My Awesome Product

Tags

Tags create the logic and control flow for tempaltes. There are denoted by curly braces and percent signs: {% and %}.

The tags themselves do not produce any output, however the content of a tag may, for example a if tag

Input

{% if product.stock > 0 %}
In stock
{% endif %}

Output

In Stock

Filters

Filters modify the output of a liquid object and is used within a output, seperated by a |

Input

{{ "demo" | append: '.html' }}

Output

demo.html