What is “liquid” as it pertains to Shopify development?

In Shopify development, “Liquid” refers to Shopify’s open-source template language that is used to load dynamic content on storefronts.

Here’s a breakdown of what Liquid is and what it does:

What is Liquid?

  • Template language created by Shopify.

  • Written in Ruby.

  • Used to render HTML pages with dynamic content from Shopify’s backend (like products, collections, cart data, etc).

  • What is it used for?
  • Creating and customizing Shopify themes.

  • Dynamically outputting data like product names, prices, customer info, blog posts, and more.

  • Controlling logic with tags, filters, and objects.

Liquid Syntax Basics

1. Objects – Output dynamic content

liquid
{{ product.title }}
{{ cart.total_price }}

2. Tags – Logic and control flow

liquid
{% if product.available %}
This product is available.
{% endif %}

3. Filters – Modify output

liquid
{{ product.title | upcase }}
{{ product.price | money }}

4. Loops

liquid
{% for product in collection.products %}
{{ product.title }}
{% endfor %}

 Where You’ll Use It

  • Inside .liquid files in a Shopify theme (e.g., product.liquid, cart.liquid, index.liquid).

  • It’s often combined with HTML, CSS, and JS in Shopify themes.

Why It’s Cool

  • Makes it easy to separate logic from design.

  • Safe for users (Shopify restricts what it can do, preventing malicious code).

  • Super customizable for developers and store owners alike.