Objects

Liquid objects contain attributes to output dynamic content on the page. For example, the product object contains an attribute called title that can be used to output the title of a product.

Liquid objects are also often refered to as Liquid variables.

To output an object's attribute on the page, wrap them in {{ and }}, as shown below:

{{ product.title }} <!-- Output: “Awesome Shoes” -->

Global Objects

The following objects can be used and accessed from any file in your theme, and are defined as global objects, or global variables:

blogs
<ul>
  {% for article in blogs.myblog.articles  %}
   <li>{{ article.title | link_to: article.url }}</li>
  {% endfor %}
</ul>

The liquid object blogs refers to the blogs in your shop. More info ›

cart

The liquid object cart refers to the cart in your shop. More info ›

collections
{% for product in collections.frontpage.products %}
  {{ product.title }}
{% endfor %}

The liquid object collections contains a list of all of the collections in a shop. More info ›

current_page
{% if current_page != 1 %} Page {{ current_page }}{% endif %}

The current_page object returns the number of the page you are on when browsing through paginated content. More info ›

current_tags
<!-- in blog.liquid -->
{% if current_tags %}
  <h1>{{ blog.title | link_to: blog.url }} &rsaquo; {{ current_tags.first }}</h1>
{% else %}
  <h1>{{ blog.title }}</h1>
{% endif %}

The current_tags object will contain a different list of tags depending on the type of template that is rendered. More info ›

customer
{% if shop.customer_accounts_enabled %}
  {% if customer %}
    <a href="/account">My Account</a> 
    {{ 'Log out' | customer_logout_link }}
  {% else %}
    {{ 'Log in' | customer_login_link }} 
    {% if shop.customer_accounts_optional %}
      {{ 'Create an account' | customer_register_link }}
    {% endif %}
  {% endif %}
{% endif %}

The liquid object customer is only defined when a customer is logged-in to the store. More info ›

linklists
<ul>
 {% for link in linklists.categories.links %}
    <li>{{ link.title | link_to: link.url }}</li>
  {% endfor %}
</ul>

The liquid object linklists contains a collection of all of the links in your shop. You can access a linklist by calling its handle on linklists. More info ›

pages
<h1>{{ pages.about.title }}</h1>
<p>{{ pages.about.author }} says...</p>
<div>{{ pages.about.content }}</div>

The liquid object pages refers to all of the pages in your shop. More info ›

page_description
{% if page_description %}
  <meta name="description" content="{{ page_description }}" /> 
{% endif %}

Merchants can specify a page_description. That field is automatically populated with the product/collection/article description. More info ›

page_title
{{ page_title }}

The liquid object page_title returns the title of the current page. More info ›

shop

The liquid object shop returns information about your shop. More info ›

template
{% if template contains 'product' %}
  WE ARE ON A PRODUCT PAGE.
{% endif %}

The liquid object template returns the name of the template used to render the current page, with the .liquid extension omitted. As a best practice, it is recommended that you use the template object as a body class. More info ›

settings
{% if settings.use_logo %}
{{ 'logo.png' | asset_url | img_tag: shop.name }}
{% else %}
<span class="no-logo">{{ shop.name }}</span>
{% endif %}
{% if settings.featured_collection and settings.featured_collection != '' and collections[settings.featured_collection].handle == settings.featured_collection and collections[settings.featured_collection].products_count > 0 %}
{% for product in collections[settings.featured_collection].products %}
  {% include 'product-loop' %}
{% endfor %}
{% endif %}

The liquid object settings gives you access to all of the theme settings. More info ›

theme
Go to your <a href="/admin/themes/{{ theme.id }}/settings">Customize theme page</a>.

The liquid object theme represents the currently active theme. More info ›

themes
We have a beautiful mobile theme, it's called {{ themes.mobile.name | link_to_theme: "mobile" }}

The liquid object themes provides access to the shop's published themes. More info ›

Return to top

Ready to put what you've learned into action?

Build an online store with Shopify. Try it free.

Experience the future of retail now.

Shopify Point of Sale. Try it free.