Liquid 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 referred to as Liquid variables.

To output an object's attribute, wrap the object's name 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:


The all_products object contains a list of all the products in your store. You can use all_products to access products by their handles. More info ›

{{ all_products['wayfarer-shades'].title }}


The blogs object returns all the blogs in your store. More info ›

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


The canonical_url object returns the canonical URL for the current page. The canonical URL is the page's "default" URL with any URL parameters removed.

For products and variants, the canonical URL is the default product page with no collection or variant selected. For example, for a product in a collection with a variant selected:

The canonical URL is the product page:

Google's Search Console Help provides more information on canonical URLs.


The cart object returns your store's cart. More info ›


The collections object returns all the collections in your store. More info ›

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


The current_page object returns the number of the page a customer is on when browsing through paginated content. More info ›

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


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

<!-- 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 customer object returns the customer that is logged in to the store. It will not return anything if a customer isn't logged in. More info ›

{% 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 linklists object returns the set of the menus and links in your store. You can access a menu by calling its handle on the linklists object. More info ›

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


The handle object returns the handle of the page that is being viewed. More info ›

{% if handle contains 'hide-from-search' %}
  <meta name="robots" content="noindex">
{% endif %}


The pages object returns a list of all the pages in your store. More info ›

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


The page_description object returns the description of the product, collection, or page that is being rendered. Descriptions for these items can be set in your Shopify admin. More info ›

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


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


The request object returns information about the domain used to access the store. Use to check which domain a customer is visiting from. For example, if you have multiple domains, you can show a different greeting based on the request:

{% if == '' %}
  Welcome USA!
{% elsif == '' %}
 Welcome Canada!
{% else %}
{% end %}


The shop object contains information about your store. More info ›


The scripts object returns information about a store's active scripts.

To access information about a script, use the syntax scripts.type, where type is the script type. There can be only one active script of a particular type. Currently, the only script type is cart_calculate_line_items.

To learn more about Shopify Scripts, visit the help content for the Script Editor app or the API documentation.

{% if scripts.cart_calculate_line_items %}
  <p>We are currently running a {{ }} promotion!</p>
{% endif %}


The settings object lets you access the settings of a store's published theme. More info ›

{% if settings.use_logo %}
{{ 'logo.png' | asset_url | img_tag: }}
{% else %}
<span class="no-logo">{{ }}</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 template object returns the name of the template that is being used to render the current page, not including its .liquid file extension. As a best practice, it's recommended that you apply the template name as a CSS class on your HTML <body> tag. More info ›

<body class="{{ template }}">


The theme object returns the store's published theme. More info ›

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

Other objects

Some Liquid objects are only used in specific circumstances.


The content_for_header object is required in theme.liquid. It must be placed inside the HTML <head> tag, and it dynamically loads all scripts required by Shopify into the document head. These scripts include Shopify analytics, Google Analytics, and scripts required for Shopify apps.

More info ›


The content_for_layout object is required in theme.liquid. It must be placed inside the HTML <body> tag, and it dynamically loads content generated by other templates such as index.liquid or product.liquid.

More info ›


Returns true if a merchant's store has any payment gateways with offsite checkouts, such as PayPal Express Checkout. Use additional_checkout_buttons to check whether these gateways exist, and content_for_additional_checkout_buttons to show the additional buttons.

More info ›


Returns checkout buttons for any active payment gateways with offsite checkouts.

More info ›

additional_checkout_buttons and content_for_additional_checkout_buttons are used in many Shopify themes:

{% if additional_checkout_buttons %}
  <div class="additional_checkout_buttons">{{ content_for_additional_checkout_buttons }}</div>
{% endif %}

Want to discuss this page?

Visit the Shopify Community