# Liquid objects

# Global objects

These objects are always available and our not dependent on the current page being shown.

# all_countries

Access a specific country by it's ISO 3166-1 numeric number or use it to loop through each country.

{{ all_countries.208.name }}
{% for country in all_countries %}
	{{ contry.name }} - {{ country.code }}
{% endfor %}

# all_products

This object contains all your products and may be used to access specific products by their handles.

{% assign product = all_products.superman-t-shirt %}
{{ product.url }}

{% assign product = all_products.batman-t-shirt %}
{{ product.url }}

# blogs

Use this object to access a specific blog or loop through to display all blogs.

<a href="{{ blogs.news.url }}">
	{{ blogs.news.title }}
</a>

{% for blog in blogs %}
    <a href="{{ blog.url }}">
        {{ blog.title }}
    </a>
{% endfor %}

# canonical_url

The canonical url can be used for SEO purposes. This object returns the current URL without any url parameters. Read more about how to consolidate duplicate URLs at Google Search Console Help (opens new window).

E.g. on this URL

https:://my-shop.codefort.io/products/summer-dress?voucher=SUMMER20

The canonical_url will return

https://my-shop.codefort.io/products/summer-dress

# cart

This object returns an instance of the customer's cart object.

# collections

This object contains all collections and can access a specific collections by it's handle or be used to loop through all collections.

{% assign products = collections.sale.products %}
{% for collection in collections %}
	{{ collection.title }}
{% endfor %}

# Handle

Returns the handle for the current page when browsing one of the following resources:

  • blogs
  • articles
  • collections
  • pages
  • products

# pages

Use this object to loop through all pages or to access a specific page.

{{ pages.delivery.content }}

# page_description

This object is used for SEO purposes and is often only used once in the layout/theme.liquid file.

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

# page_title

The page_title is used for SEO and user experience purposes. This contains the Meta title defined on products, pages etc.

<title>{{ page_title }} | {{ shop.name }}</title>