Developers · Liquid
Liquid Objects: Details
Last updated 1 November 2026
Liquid objects hold data that you can use in your pages, partials and layouts. Examples of Object types include:
- Resources
- Standard Insites content
- Functional elements that help build interactivity.
Objects might represent a single data point or contain multiple properties. Some properties might represent a related object, such as a product in a category or collection of products.
We cover the following most commonly-used objects on Insites, namely:
- forloop
- tablerowloop
forloop
The forloop object is available inside a
This section discusses the following usage examples of the forloop object:
- forloop.first
- forloop.index
- forloop.index0
- forloop.last
- forloop.length
- forloop.rindex
- forloop.rindex0
In these examples,
forloop.first
Returns true if it's the first iteration of the
Input
{% for product in products %}
{% if forloop.first == true %}
First time through!
{% else %}
Not the first time.
{% endif %}
{% endfor %}Output
First time through!
Not the first time.
Not the first time.
Not the first time.
Not the first time.forloop.index
Returns the current index of the
Input
{% for product in products %}
{{ forloop.index }}
{% else %}
// no products
{% endfor %}Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16forloop.index0
Returns the current index of the
Input
{% for product in products %}
{{ forloop.index0 }}
{% endfor %}Output
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15forloop.last
Returns true if it's the last iteration of the
Input
{% for product in products %}
{% if forloop.last == true %}
This is the last iteration!
{% else %}
Keep going...
{% endif %}
{% endfor %}Output
Keep going...
Keep going...
Keep going...
Keep going...
Keep going...
This is the last iteration!forloop.length
Returns the number of iterations of the loop.
Input
{% comment %} if products contains 4 products {% endcomment %}
{% for product in products %}
{% if forloop.first %}
<p>This collection has {{ forloop.length }} products:</p>
{% endif %}
<p>{{ product.title }}</p>
{% endfor %}Output
This collection has 4 products:
Apple
Orange
Peach
Plumforloop.rindex
Returns
Input
{% for product in products %}
{{ forloop.rindex }}
{% endfor %}Output
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1forloop.rindex0
Returns
Input
{% for product in products %}
{{ forloop.rindex0 }}
{% endfor %}Output
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0tablerowloop
The tablerow object is used within the
- tablerowloop.length
- tablerowloop.index
- tablerowloop.index0
- tablerowloop.rindex
- tablerowloop.rindex0
- tablerowloop.first
- tablerowloop.last
- tablerowloop.col
- tablerowloop.col0
- tablerowloop.col_first
- tablerowloop.col_last
tablerowloop.length
Returns the number of iterations of the
tablerowloop.index
Returns the current index of the
tablerowloop.index0
Returns the current index of the
tablerowloop.rindex
Returns
tablerowloop.rindex0
Returns
tablerowloop.first
Returns
tablerowloop.last
Returns
tablerowloop.col
Returns the index of the current column, starting at 1.
tablerowloop.col0
Returns the index of the current column, starting at 0.
tablerowloop.col_first
Returns
tablerowloop.col_last
Returns
Note
This topic is a compilation of knowledge found at Shopify Themes, Liquid Documentation, Liquid Gem Documentation, and Liquid for Designers.