# Liquid Reference
## What is a Template Language?
A template language enables developers to create a single template hosting static content while dynamically inserting information depending on where the template is rendered. For example, a product template can dynamically render product attributes like image, title, and price based on the current product being viewed.
## Variations of Liquid
The Liquid variation documented here extends the open-source version for use with Shopify themes, including tags, filters, and objects specific to Shopify stores and storefront functionality.
Shopify uses slightly different Liquid versions for other features not included in this reference:
- **Notification templates**: For email notifications
- **Shopify Flow**: For workflow automation
- **Order printer templates**: For order printing
- **Packing slip templates**: For packing slip generation
## Liquid Basics
Liquid dynamically outputs objects and their properties. You can modify output using logic with tags or alter it directly with filters. Objects and properties use six basic data types, along with basic logical and comparison operators.
## Defining Logic with Tags
Liquid tags define logic that instructs templates what to do. Tags use curly brace percentage delimiters `{% %}`. The text within delimiters is an instruction, not renderable content.
### Example: Conditional Logic
```liquid
{% if product.available %}
Price: $99.99
{% else %}
Sorry, this product is sold out.
{% endif %}
```
When `product.available` returns true, the price displays. Otherwise, the "sold out" message appears.
Use the `liquid` tag to nest multiple tags inside one set of delimiters.
### Tags with Parameters
Some tags accept optional or required parameters. For example, the `for` tag accepts an optional `limit` parameter:
```liquid
{% assign numbers = '1,2,3,4,5' | split: ',' %}
{% for item in numbers limit:2 -%}
{{ item }}
{% endfor %}
```
Output: `1` and `2`
## Modifying Output with Filters
Filters modify variable and object output. Use the pipe character `|` followed by the filter name:
```liquid
{{ product.title | upcase }}
```
### Filters with Parameters
Many filters accept parameters adjusting their output:
```liquid
{{ product.title | remove: 'Health' }}
```
For "Health potion", this outputs: `potion`
### Using Multiple Filters
Multiple filters apply left to right:
```liquid
{{ product.title | upcase | remove: 'HEALTH' }}
```
For "Health potion", this outputs: `POTION`
## Referencing Objects
Liquid objects represent variables for building themes. Object types include store resources (collections, products), standard content (like `content_for_header`), and functional elements (like `paginate` and `search`).
### Usage
Output objects using double curly brace delimiters `{{ }}`. Access object properties using dot notation:
```liquid
{{ product.title }}
```
### Object Access
Objects are available in three ways:
- **Globally**: In any Liquid file (excluding checkout.liquid and Liquid asset files)
- **In templates**: In specific templates and their sections or blocks
- **Through parent objects**: Returned as properties of other objects
### Creating Variables
Use variable tags like `assign` or `capture` to create custom variables. Syntactically, Liquid treats variables identically to objects.
## Resources & Tools
Additional resources and tools are available for Liquid development. Refer to the [official Shopify Liquid documentation](https://shopify.github.io/liquid/) and theme development guides.