Liquid output can be one of six data types.


Any series of characters, wrapped in single or double quotes.



You can check whether a string is empty with the blank object.


Numeric values, including floats and integers.


A binary value, either true or false.


An undefined value.

Tags or outputs that return nil don't print anything to the page. They are also treated as false.



A string with the characters “nil” is not treated the same as nil.


A list of variables of any type.

To access all of the items in an array, you can loop through each item in the array using a for or tablerow tag.

You can use square bracket [ ] notation to access a specific item in an array. Array indexing starts at zero.

You can’t initialize arrays using only Liquid. You can, however, use the split filter to break a single string into an array of substrings.


An empty object is returned if you try to access an object that is defined, but has no value. For example a page or product that’s been deleted, or a setting with no value.

You can compare an object with empty to check whether an object exists before you access any of its attributes.

{% assign contact_us_page_id = '333653' %}
{% unless pages[contact_us_page_id] == empty %}
  <h1>{{ page.title }}</h1>
  <div>{{ page.content }}</div>
{% endunless %}
  "page": {
    "title": "Contact us",
    "content": "Some content...",
<h1>Contact us</h1>
<div>Some content...</div>