# Table of Contents - [Types – Liquid template language](#types-liquid-template-language) - [Variations of Liquid – Liquid template language](#variations-of-liquid-liquid-template-language) - [Whitespace control – Liquid template language](#whitespace-control-liquid-template-language) - [Control flow – Liquid template language](#control-flow-liquid-template-language) - [Iteration – Liquid template language](#iteration-liquid-template-language) - [Template – Liquid template language](#template-liquid-template-language) - [abs – Liquid template language](#abs-liquid-template-language) - [Variable – Liquid template language](#variable-liquid-template-language) - [append – Liquid template language](#append-liquid-template-language) - [at_least – Liquid template language](#at-least-liquid-template-language) - [at_most – Liquid template language](#at-most-liquid-template-language) - [capitalize – Liquid template language](#capitalize-liquid-template-language) - [ceil – Liquid template language](#ceil-liquid-template-language) - [compact – Liquid template language](#compact-liquid-template-language) - [concat – Liquid template language](#concat-liquid-template-language) - [date – Liquid template language](#date-liquid-template-language) - [default – Liquid template language](#default-liquid-template-language) - [divided_by – Liquid template language](#divided-by-liquid-template-language) - [downcase – Liquid template language](#downcase-liquid-template-language) - [escape – Liquid template language](#escape-liquid-template-language) - [escape_once – Liquid template language](#escape-once-liquid-template-language) - [first – Liquid template language](#first-liquid-template-language) - [join – Liquid template language](#join-liquid-template-language) - [floor – Liquid template language](#floor-liquid-template-language) - [lstrip – Liquid template language](#lstrip-liquid-template-language) - [last – Liquid template language](#last-liquid-template-language) - [map – Liquid template language](#map-liquid-template-language) - [minus – Liquid template language](#minus-liquid-template-language) - [modulo – Liquid template language](#modulo-liquid-template-language) - [newline_to_br – Liquid template language](#newline-to-br-liquid-template-language) - [remove – Liquid template language](#remove-liquid-template-language) - [plus – Liquid template language](#plus-liquid-template-language) - [prepend – Liquid template language](#prepend-liquid-template-language) - [remove_first – Liquid template language](#remove-first-liquid-template-language) - [replace_first – Liquid template language](#replace-first-liquid-template-language) - [remove_last – Liquid template language](#remove-last-liquid-template-language) - [replace – Liquid template language](#replace-liquid-template-language) - [replace_last – Liquid template language](#replace-last-liquid-template-language) - [reverse – Liquid template language](#reverse-liquid-template-language) - [round – Liquid template language](#round-liquid-template-language) - [rstrip – Liquid template language](#rstrip-liquid-template-language) - [size – Liquid template language](#size-liquid-template-language) - [slice – Liquid template language](#slice-liquid-template-language) - [sort – Liquid template language](#sort-liquid-template-language) - [strip – Liquid template language](#strip-liquid-template-language) - [sort_natural – Liquid template language](#sort-natural-liquid-template-language) - [split – Liquid template language](#split-liquid-template-language) - [strip_html – Liquid template language](#strip-html-liquid-template-language) - [strip_newlines – Liquid template language](#strip-newlines-liquid-template-language) - [times – Liquid template language](#times-liquid-template-language) - [sum – Liquid template language](#sum-liquid-template-language) - [truncate – Liquid template language](#truncate-liquid-template-language) - [uniq – Liquid template language](#uniq-liquid-template-language) - [truncatewords – Liquid template language](#truncatewords-liquid-template-language) - [upcase – Liquid template language](#upcase-liquid-template-language) - [url_encode – Liquid template language](#url-encode-liquid-template-language) - [url_decode – Liquid template language](#url-decode-liquid-template-language) - [where – Liquid template language](#where-liquid-template-language) - [Truthy and falsy – Liquid template language](#truthy-and-falsy-liquid-template-language) - [Operators – Liquid template language](#operators-liquid-template-language) - [Introduction – Liquid template language](#introduction-liquid-template-language) --- # Types – Liquid template language Menu Types ===== Liquid objects can be one of six types: * [String](https://shopify.github.io/liquid/basics/types/#string) * [Number](https://shopify.github.io/liquid/basics/types/#number) * [Boolean](https://shopify.github.io/liquid/basics/types/#boolean) * [Nil](https://shopify.github.io/liquid/basics/types/#nil) * [Array](https://shopify.github.io/liquid/basics/types/#array) * [EmptyDrop](https://shopify.github.io/liquid/basics/types/#emptydrop) You can initialize Liquid variables using [`assign`](https://shopify.github.io/liquid/tags/variable/#assign) or [`capture`](https://shopify.github.io/liquid/tags/variable/#capture) tags. String ------ Strings are sequences of characters wrapped in single or double quotes: {% assign my_string = "Hello World!" %} Liquid does not convert escape sequences into special characters. Number ------ Numbers include floats and integers: {% assign my_int = 25 %} {% assign my_float = -39.756 %} Boolean ------- Booleans are either `true` or `false`. No quotations are necessary when declaring a boolean: {% assign foo = true %} {% assign bar = false %} Nil --- Nil is a special empty value that is returned when Liquid code has no results. It is **not** a string with the characters “nil”. Nil is [treated as false](https://shopify.github.io/liquid/basics/truthy-and-falsy/#falsy) in the conditions of `if` blocks and other Liquid tags that check the truthfulness of a statement. In the following example, if the user does not exist (that is, `user` returns `nil`), Liquid will not print the greeting: {% if user %} Hello {{ user.name }}! {% endif %} Tags or outputs that return `nil` will not print anything to the page. Input The current user is {{ user.name }} Output The current user is Array ----- Arrays hold lists of variables of any type. ### Accessing items in arrays To access all the items in an array, you can loop through each item in the array using an [iteration tag](https://shopify.github.io/liquid/tags/iteration/) . Input {% for user in site.users %} {{ user }} {% endfor %} Output Tobi Laura Tetsuro Adam ### Accessing specific items in arrays You can use square bracket `[` `]` notation to access a specific item in an array. Array indexing starts at zero. A negative index will count from the end of the array. Input {{ site.users[0] }} {{ site.users[1] }} {{ site.users[-1] }} Output Tobi Laura Adam ### Initializing arrays You cannot initialize arrays using only Liquid. You can, however, use the [`split`](https://shopify.github.io/liquid/filters/split/) filter to break a string into an array of substrings. EmptyDrop --------- An EmptyDrop object is returned if you try to access a deleted object. In the example below, `page_1`, `page_2` and `page_3` are all EmptyDrop objects: {% assign variable = "hello" %} {% assign page_1 = pages[variable] %} {% assign page_2 = pages["does-not-exist"] %} {% assign page_3 = pages.this-handle-does-not-exist %} ### Checking for emptiness You can check to see if an object exists or not before you access any of its attributes. {% unless pages == empty %}

{{ pages.frontpage.title }}

{{ pages.frontpage.content }}
{% endunless %} Both empty strings and empty arrays will return `true` if checked for equivalence with `empty`. --- # Variations of Liquid – Liquid template language Menu Variations of Liquid ==================== Liquid is a flexible, safe language, and is used in many different environments. Liquid was created for use in [Shopify](https://www.shopify.com/) stores, and is also used extensively on [Jekyll](https://jekyllrb.com/) websites. Over time, both Shopify and Jekyll have added their own objects, tags, and filters to Liquid. The most popular versions of Liquid that exist are **Liquid**, **Shopify Liquid for themes**, and **Jekyll Liquid**. This site documents the latest version of **Liquid** including betas and release candidates — that is, Liquid as it exists outside of Shopify and Jekyll. If you download the Liquid repository or install it as a [gem](https://rubygems.org/gems/liquid) , you will get access to whatever objects, tags, and filters are in the version of Liquid that you chose. Shopify ------- Shopify always uses the latest version of Liquid as a base, but Shopify adds a significant number of objects, tags, and filters to Liquid for use in merchants’ stores. These include objects representing store, product, and customer information, and filters for displaying store data and manipulating storefront assets like product images. Shopify has several versions of Liquid. The most popular version is used to build Shopify themes. To learn about the Liquid elements that you can use to build Shopify themes, and to learn about the other versions of Liquid at Shopify, refer to the [Shopify Liquid reference](https://shopify.dev/api/liquid) . Jekyll ------ [Jekyll](https://jekyllrb.com/) is a static site generator, a command-line tool that creates websites by merging templates with content files. Jekyll uses Liquid as its template language, and adds a few objects, tags, and filters. These include objects representing content pages, tags for including snippets of content in others, and filters for manipulating strings and URLs. Jekyll also powers [GitHub Pages](https://pages.github.com/) , a web hosting service that lets you push a Jekyll installation to a GitHub repository and have the resulting website published. This website is built using GitHub Pages. Jekyll might not be using the latest version of Liquid. This means that the tags and filters listed on this site may not work in Jekyll. Often the Jekyll project will wait for a stable release of Liquid rather than using a beta or release candidate version. To see which version of Liquid is being used by Jekyll or GitHub Pages, check the **runtime dependencies** section of the gem page for [Jekyll](https://rubygems.org/gems/jekyll) or [GitHub Pages](https://rubygems.org/gems/github-pages) . Jekyll’s version of Liquid is documented in the [Liquid section of Jekyll’s documentation](https://jekyllrb.com/docs/liquid/) . If you want to try out Jekyll’s version of Liquid, you can clone the Jekyll project or install Jekyll as a gem and test Liquid on a static site. --- # Whitespace control – Liquid template language Menu Whitespace control ================== In Liquid, you can include a hyphen in your tag syntax `{{-`, `-}}`, `{%-`, and `-%}` to strip whitespace from the left or right side of a rendered tag. Normally, even if it doesn’t print text, any line of Liquid in your template will still print a blank line in your rendered HTML: Input {% assign my_variable = "tomato" %} {{ my_variable }} Notice the blank line before “tomato” in the rendered template: Output tomato By including a hyphen in your `assign` closing delimiter, you can strip the whitespace following it from the rendered template: Input {% assign my_variable = "tomato" -%} {{ my_variable }} Output tomato If you don’t want any of your tags to print whitespace, as a general rule you can add hyphens to both sides of all your tags (`{%-` and `-%}`): Input {% assign username = "John G. Chalmers-Smith" %} {% if username and username.size > 10 %} Wow, {{ username }} , you have a long name! {% else %} Hello there! {% endif %} Output without whitespace control Wow, John G. Chalmers-Smith , you have a long name! Input {% assign username = "John G. Chalmers-Smith" -%} {%- if username and username.size > 10 -%} Wow, {{ username -}} , you have a long name! {%- else -%} Hello there! {%- endif %} Output with whitespace control Wow, John G. Chalmers-Smith, you have a long name! --- # Control flow – Liquid template language Menu Control flow ============ Control flow tags create conditions that decide whether blocks of Liquid code get executed. if -- Executes a block of code only if a certain condition is `true`. Input {% if product.title == "Awesome Shoes" %} These shoes are awesome! {% endif %} Output These shoes are awesome! unless ------ The opposite of `if` – executes a block of code only if a certain condition is **not** met. Input {% unless product.title == "Awesome Shoes" %} These shoes are not awesome. {% endunless %} Output These shoes are not awesome. This would be the equivalent of doing the following: {% if product.title != "Awesome Shoes" %} These shoes are not awesome. {% endif %} elsif / else ------------ Adds more conditions within an `if` or `unless` block. Input {% if customer.name == "kevin" %} Hey Kevin! {% elsif customer.name == "anonymous" %} Hey Anonymous! {% else %} Hi Stranger! {% endif %} Output Hey Anonymous! case/when --------- Creates a switch statement to execute a particular block of code when a variable has a specified value. `case` initializes the switch statement, and `when` statements define the various conditions. A `when` tag can accept multiple values. When multiple values are provided, the expression is returned when the variable matches any of the values inside of the tag. Provide the values as a comma-separated list, or separate them using an `or` operator. An optional `else` statement at the end of the case provides code to execute if none of the conditions are met. Input {% assign handle = "cake" %} {% case handle %} {% when "cake" %} This is a cake {% when "cookie", "biscuit" %} This is a cookie {% else %} This is not a cake nor a cookie {% endcase %} Output This is a cake --- # Iteration – Liquid template language Menu Iteration ========= Iteration tags repeatedly run blocks of code. for --- Repeatedly executes a block of code. For a full list of attributes available within a `for` loop, refer to the [`forloop` object](https://shopify.github.io/liquid/tags/iteration/#forloop-object) . Input {% for product in collection.products %} {{ product.title }} {% endfor %} Output hat shirt pants ### else Specifies a fallback case for a `for` loop which will run if the loop has zero length. Input {% for product in collection.products %} {{ product.title }} {% else %} The collection is empty. {% endfor %} Output The collection is empty. ### break Causes the loop to stop iterating when it encounters the `break` tag. Input {% for i in (1..5) %} {% if i == 4 %} {% break %} {% else %} {{ i }} {% endif %} {% endfor %} Output 1 2 3 ### continue Causes the loop to skip the current iteration when it encounters the `continue` tag. Input {% for i in (1..5) %} {% if i == 4 %} {% continue %} {% else %} {{ i }} {% endif %} {% endfor %} Output 1 2 3 5 for (parameters) ---------------- ### limit Limits the loop to the specified number of iterations. Input {% for item in array limit:2 %} {{ item }} {% endfor %} Output 1 2 ### offset Begins the loop at the specified index. Input {% for item in array offset:2 %} {{ item }} {% endfor %} Output 3 4 5 6 To start a loop from where the last loop using the same iterator left off, pass the special word `continue`. Input {% for item in array limit: 3 %} {{ item }} {% endfor %} {% for item in array limit: 3 offset: continue %} {{ item }} {% endfor %} Output 1 2 3 4 5 6 ### range Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers, and can be pulled from a variable. Input {% for i in (3..5) %} {{ i }} {% endfor %} {% assign num = 4 %} {% assign range = (1..num) %} {% for i in range %} {{ i }} {% endfor %} Output 3 4 5 1 2 3 4 ### reversed Reverses the order of the loop. Note that this flag’s spelling is different from the filter `reverse`. Input {% for item in array reversed %} {{ item }} {% endfor %} Output 6 5 4 3 2 1 forloop (object) ---------------- Information about a parent [`for` loop](https://shopify.github.io/liquid/tags/iteration/#for) . { "first": true, "index": 1, "index0": 0, "last": false, "length": 4, "rindex": 3 } ### Use the `forloop` object Input {% assign smoothie_flavors = "orange, strawberry, banana" | split: ", " %} {% for flavor in smoothie_flavors -%} {%- if forloop.length > 0 -%} {{ flavor }}{% unless forloop.last %}-{% endunless -%} {%- endif -%} {% endfor %} Output orange-strawberry-banana ### forloop (properties) | Property | Description | Returns | | --- | --- | --- | | `length` | The total number of iterations in the loop. | `number` | | `parentloop` | The parent `forloop` object. If the current `for` loop isn’t nested inside another `for` loop, then `nil` is returned. | `forloop` | | `index` | The 1-based index of the current iteration. | `number` | | `index0` | The 0-based index of the current iteration. | `number` | | `rindex` | The 1-based index of the current iteration, in reverse order. | `number` | | `rindex0` | The 0-based index of the current iteration, in reverse order. | `number` | | `first` | Returns `true` if the current iteration is the first. Returns `false` if not. | `boolean` | | `last` | Returns `true` if the current iteration is the last. Returns `false` if not. | `boolean` | cycle ----- Loops through a group of strings and prints them in the order that they were passed as arguments. Each time `cycle` is called, the next string argument is printed. `cycle` must be used within a [for](https://shopify.github.io/liquid/tags/iteration/#for) loop block. Input {% cycle "one", "two", "three" %} {% cycle "one", "two", "three" %} {% cycle "one", "two", "three" %} {% cycle "one", "two", "three" %} Output one two three one Uses for `cycle` include: * applying odd/even classes to rows in a table * applying a unique class to the last product thumbnail in a row cycle (parameters) ------------------ `cycle` accepts a “cycle group” parameter in cases where you need multiple `cycle` blocks in one template. If no name is supplied for the cycle group, then it is assumed that multiple calls with the same parameters are one group. Input {% cycle "first": "one", "two", "three" %} {% cycle "second": "one", "two", "three" %} {% cycle "second": "one", "two", "three" %} {% cycle "first": "one", "two", "three" %} Output one one two two tablerow -------- Generates an HTML table. Must be wrapped in opening `` and closing `
` HTML tags. For a full list of attributes available within a `tablerow` loop, refer to the [`tablerowloop` object](https://shopify.github.io/liquid/tags/iteration/#tablerowloop-object) . Input {% tablerow product in collection.products %} {{ product.title }} {% endtablerow %}
Output
Cool Shirt Alien Poster Batman Poster Bullseye Shirt Another Classic Vinyl Awesome Jeans
tablerow (parameters) --------------------- ### cols Defines how many columns the tables should have. Input {% tablerow product in collection.products cols:2 %} {{ product.title }} {% endtablerow %} Output
Cool Shirt Alien Poster
Batman Poster Bullseye Shirt
Another Classic Vinyl Awesome Jeans
#### limit Exits the `tablerow` loop after a specific index. {% tablerow product in collection.products cols:2 limit:3 %} {{ product.title }} {% endtablerow %} ### offset Starts the `tablerow` loop after a specific index. {% tablerow product in collection.products cols:2 offset:3 %} {{ product.title }} {% endtablerow %} ### range Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers. {% assign num = 4 %} {% tablerow i in (1..num) %} {{ i }} {% endtablerow %}
{% tablerow i in (3..5) %} {{ i }} {% endtablerow %}
tablerowloop (object) --------------------- Information about a parent [`tablerow` loop](https://shopify.github.io/liquid/tags/iteration/#tablerow) . { "col": 1, "col0": 0, "col_first": true, "col_last": false, "first": true, "index": 1, "index0": 0, "last": false, "length": 5, "rindex": 5, "rindex0": 4, "row": 1 } ### tablerowloop (properties) | Property | Description | Returns | | --- | --- | --- | | `col` | The 1-based index of the current column. | `number` | | `col0` | The 0-based index of the current column. | `number` | | `col_first` | Returns `true` if the current column is the first in the row. Returns `false` if not. | `boolean` | | `col_last` | Returns `true` if the current column is the last in the row. Returns `false` if not. | `boolean` | | `first` | Returns `true` if the current iteration is the first. Returns `false` if not. | `boolean` | | `index` | The 1-based index of the current iteration. | `number` | | `index0` | The 0-based index of the current iteration. | `number` | | `last` | Returns `true` if the current iteration is the last. Returns `false` if not. | `boolean` | | `length` | The total number of iterations in the loop. | `number` | | `rindex` | The 1-based index of the current iteration, in reverse order. | `number` | | `rindex0` | The 0-based index of the current iteration, in reverse order. | `number` | | `row` | The 1-based index of current row. | `number` | --- # Template – Liquid template language Menu Template ======== Template tags tell Liquid where to disable processing for comments or non-Liquid markup, and how to establish relations among template files. comment ------- Allows you to leave un-rendered code inside a Liquid template. Any text within the opening and closing `comment` blocks will not be printed, and any Liquid code within will not be executed. Input {% assign verb = "turned" %} {% comment %} {% assign verb = "converted" %} {% endcomment %} Anything you put between {% comment %} and {% endcomment %} tags is {{ verb }} into a comment. Output Anything you put between tags is turned into a comment. Inline comments --------------- You can use inline comments to prevent an expression from being rendered or output. Any text inside of the tag also won’t be rendered or output. You can create multi-line inline comments. However, each line must begin with a `#`. Input {% # for i in (1..3) -%} {{ i }} {% # endfor %} {% ############################### # This is a comment # across multiple lines ############################### %} Output ### Inline comments inside `liquid` tags You can use the inline comment tag inside [`liquid` tags](https://shopify.github.io/liquid/tags/template/#liquid) . The tag must be used for each line that you want to comment. Input {% liquid # this is a comment assign topic = 'Learning about comments!' echo topic %} Output Learning about comments! raw --- Temporarily disables tag processing. This is useful for generating certain content that uses conflicting syntax, such as [Mustache](https://mustache.github.io/) or [Handlebars](https://handlebarsjs.com/) . Input {% raw %} In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. {% endraw %} Output In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. liquid ------ Encloses multiple tags within one set of delimiters, to allow writing Liquid logic more concisely. {% liquid case section.blocks.size when 1 assign column_size = '' when 2 assign column_size = 'one-half' when 3 assign column_size = 'one-third' else assign column_size = 'one-quarter' endcase %} Because any tag blocks opened within a `liquid` tag must also be closed within the same tag, use [`echo`](https://shopify.github.io/liquid/tags/template/#echo) to output data. echo ---- Outputs an expression in the rendered HTML. This is identical to wrapping an expression in `{{` and `}}`, but works inside [`liquid`](https://shopify.github.io/liquid/tags/template/#liquid) tags and supports [filters](https://shopify.github.io/liquid/basics/introduction/#filters) . Input {% liquid for product in collection.products echo product.title | capitalize endfor %} Output Hat Shirt Pants render ------ Insert the rendered content of another template within the current template. {% render "template-name" %} Note that you don’t need to write the file’s `.liquid` extension. The code within the rendered template does **not** automatically have access to the variables assigned using [variable tags](https://shopify.github.io/liquid/tags/variable/) within the parent template. Similarly, variables assigned within the rendered template cannot be accessed by code in any other template. render (parameters) ------------------- Variables assigned using [variable tags](https://shopify.github.io/liquid/tags/variable/) can be passed to a template by listing them as parameters on the `render` tag. {% assign my_variable = "apples" %} {% render "name", my_variable: my_variable, my_other_variable: "oranges" %} One or more objects can be passed to a template. {% assign featured_product = all_products["product_handle"] %} {% render "product", product: featured_product %} ### with A single object can be passed to a template by using the `with` and optional `as` parameters. {% assign featured_product = all_products["product_handle"] %} {% render "product" with featured_product as product %} In the example above, the `product` variable in the rendered template will hold the value of `featured_product` from the parent template. ### for A template can be rendered once for each value of an enumerable object by using the `for` and optional `as` parameters. {% assign variants = product.variants %} {% render "product_variant" for variants as variant %} In the example above, the template will be rendered once for each variant of the product, and the `variant` variable will hold a different product variant object for each iteration. When using the `for` parameter, the [`forloop`](https://shopify.github.io/liquid/tags/iteration/#forloop-object) object is accessible within the rendered template. include ------- _The `include` tag is deprecated; please use [`render`](https://shopify.github.io/liquid/tags/template/#render) instead._ Insert the rendered content of another template within the current template. {% include "template-name" %} The `include` tag works similarly to the [`render`](https://shopify.github.io/liquid/tags/template/#render) tag, but it allows the code inside of the rendered template to access and overwrite the variables within its parent template. It has been deprecated because the way that it handles variables reduces performance and makes Liquid code harder to both read and maintain. Note that when a template is rendered using the [`render`](https://shopify.github.io/liquid/tags/template/#render) tag, the `include` tag cannot be used within the template. --- # abs – Liquid template language Menu abs === Returns the absolute value of a number. Input {{ -17 | abs }} {{ 4 | abs }} Output 17 4 `abs` will also work on a string that only contains a number. Input {{ "-19.86" | abs }} Output 19.86 --- # Variable – Liquid template language Menu Variable ======== Variable tags create new Liquid variables. assign ------ Creates a new named variable. Input {% assign my_variable = false %} {% if my_variable != true %} This statement is valid. {% endif %} Output This statement is valid. Wrap a value in quotations `"` to save it as a string variable. Input {% assign foo = "bar" %} {{ foo }} Output bar capture ------- Captures the string inside of the opening and closing tags and assigns it to a variable. Variables created using `capture` are stored as strings. Input {% capture my_variable %}I am being captured.{% endcapture %} {{ my_variable }} Output I am being captured. Using `capture`, you can create complex strings using other variables created with `assign`. Input {% assign favorite_food = "pizza" %} {% assign age = 35 %} {% capture about_me %} I am {{ age }} and my favorite food is {{ favorite_food }}. {% endcapture %} {{ about_me }} Output I am 35 and my favourite food is pizza. increment --------- Creates and outputs a new number variable with initial value `0`. On subsequent calls, it increases its value by one and outputs the new value. Input {% increment my_counter %} {% increment my_counter %} {% increment my_counter %} Output 0 1 2 Variables created using `increment` are independent from variables created using `assign` or `capture`. In the example below, a variable named “var” is created using `assign`. The `increment` tag is then used several times on a variable with the same name. Note that the `increment` tag does not affect the value of “var” that was created using `assign`. Input {% assign var = 10 %} {% increment var %} {% increment var %} {% increment var %} {{ var }} Output 0 1 2 10 decrement --------- Creates and outputs a new number variable with initial value `-1`. On subsequent calls, it decreases its value by one and outputs the new value. Input {% decrement variable %} {% decrement variable %} {% decrement variable %} Output -1 -2 -3 Like [increment](https://shopify.github.io/liquid/tags/variable/#increment) , variables declared using `decrement` are independent from variables created using `assign` or `capture`. --- # append – Liquid template language Menu append ====== Adds the specified string to the end of another string. Input {{ "/my/fancy/url" | append: ".html" }} Output /my/fancy/url.html `append` can also accept a variable as its argument. Input {% assign filename = "/index.html" %} {{ "website.com" | append: filename }} Output website.com/index.html --- # at_least – Liquid template language Menu at\_least ========= Limits a number to a minimum value. Input {{ 4 | at_least: 5 }} {{ 4 | at_least: 3 }} Output 5 4 --- # at_most – Liquid template language Menu at\_most ======== Limits a number to a maximum value. Input {{ 4 | at_most: 5 }} {{ 4 | at_most: 3 }} Output 4 3 --- # capitalize – Liquid template language Menu capitalize ========== Makes the first character of a string capitalized and converts the remaining characters to lowercase. Input {{ "title" | capitalize }} Output Title Only the first character of a string is capitalized, so later words are not capitalized: Input {{ "my GREAT title" | capitalize }} Output My great title --- # ceil – Liquid template language Menu ceil ==== Rounds an input up to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied. Input {{ 1.2 | ceil }} {{ 2.0 | ceil }} {{ 183.357 | ceil }} Output 2 2 184 Here the input value is a string: Input {{ "3.5" | ceil }} Output 4 --- # compact – Liquid template language Menu compact ======= Removes any `nil` values from an array. For this example, assume `site.pages` is an array of content pages for a website, and some of these pages have an attribute called `category` that specifies their content category. If we `map` those categories to an array, some of the array items might be `nil` if any pages do not have a `category` attribute. Input {% assign site_categories = site.pages | map: "category" %} {% for category in site_categories %} - {{ category }} {% endfor %} Output - business - celebrities - - lifestyle - sports - - technology By using `compact` when we create our `site_categories` array, we can remove all the `nil` values in the array. Input {% assign site_categories = site.pages | map: "category" | compact %} {% for category in site_categories %} - {{ category }} {% endfor %} Output - business - celebrities - lifestyle - sports - technology --- # concat – Liquid template language Menu concat ====== Concatenates (joins together) multiple arrays. The resulting array contains all the items from the input arrays. Input {% assign fruits = "apples, oranges, peaches" | split: ", " %} {% assign vegetables = "carrots, turnips, potatoes" | split: ", " %} {% assign everything = fruits | concat: vegetables %} {% for item in everything %} - {{ item }} {% endfor %} Output - apples - oranges - peaches - carrots - turnips - potatoes You can string together multiple `concat` filters to join more than two arrays. Input {% assign furniture = "chairs, tables, shelves" | split: ", " %} {% assign everything = fruits | concat: vegetables | concat: furniture %} {% for item in everything %} - {{ item }} {% endfor %} Output - apples - oranges - peaches - carrots - turnips - potatoes - chairs - tables - shelves --- # date – Liquid template language Menu date ==== Converts a timestamp into another date format. The format for this syntax is the same as [`strftime`](http://strftime.net/) . The input uses the same format as Ruby’s [`Time.parse`](https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html#method-c-parse) . Input {{ article.published_at | date: "%a, %b %d, %y" }} Output Fri, Jul 17, 15 Input {{ article.published_at | date: "%Y" }} Output 2015 `date` works on strings if they contain well-formatted dates. Input {{ "March 14, 2016" | date: "%b %d, %y" }} Output Mar 14, 16 To get the current time, pass the special word `"now"` (or `"today"`) to `date`. Input This page was last updated at {{ "now" | date: "%Y-%m-%d %H:%M" }}. Output This page was last updated at 2024-10-23 00:46. Note that the value will be the current time of when the page was last generated from the template, not when the page is presented to a user if caching or static site generation is involved. --- # default – Liquid template language Menu default ======= Sets a default value for any variable with no assigned value. `default` will show its value if the input is `nil`, `false`, or empty. In this example, `product_price` is not defined, so the default value is used. Input {{ product_price | default: 2.99 }} Output 2.99 In this example, `product_price` is defined, so the default value is not used. Input {% assign product_price = 4.99 %} {{ product_price | default: 2.99 }} Output 4.99 In this example, `product_price` is empty, so the default value is used. Input {% assign product_price = "" %} {{ product_price | default: 2.99 }} Output 2.99 ### Allowing `false` To allow variables to return `false` instead of the default value, you can use the `allow_false` parameter. Input {% assign display_price = false %} {{ display_price | default: true, allow_false: true }} Output false --- # divided_by – Liquid template language Menu divided\_by =========== Divides a number by another number. The result is rounded down to the nearest integer (that is, the [floor](https://shopify.github.io/liquid/filters/floor/) ) if the divisor is an integer. Input {{ 16 | divided_by: 4 }} {{ 5 | divided_by: 3 }} Output 4 1 ### Controlling rounding `divided_by` produces a result of the same type as the divisor — that is, if you divide by an integer, the result will be an integer. If you divide by a float (a number with a decimal in it), the result will be a float. For example, here the divisor is an integer: Input {{ 20 | divided_by: 7 }} Output 2 Here it is a float: Input {{ 20 | divided_by: 7.0 }} Output 2.857142857142857 ### Changing variable types You might want to use a variable as a divisor, in which case you can’t simply add `.0` to convert it to a float. In these cases, you can `assign` a version of your variable converted to a float using the `times` filter. In this example, we’re dividing by a variable that contains an integer, so we get an integer: Input {% assign my_integer = 7 %} {{ 20 | divided_by: my_integer }} Output 2 Here, we [multiply](https://shopify.github.io/liquid/filters/times/) the variable by `1.0` to get a float, then divide by the float instead: Input {% assign my_integer = 7 %} {% assign my_float = my_integer | times: 1.0 %} {{ 20 | divided_by: my_float }} Output 2.857142857142857 --- # downcase – Liquid template language Menu downcase ======== Makes each character in a string lowercase. It has no effect on strings which are already all lowercase. Input {{ "Parker Moore" | downcase }} Output parker moore Input {{ "apple" | downcase }} Output apple --- # escape – Liquid template language Menu escape ====== Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn’t change strings that don’t have anything to escape. Input {{ "Have you read 'James & the Giant Peach'?" | escape }} Output Have you read 'James & the Giant Peach'? Input {{ "Tetsuro Takara" | escape }} Output Tetsuro Takara --- # escape_once – Liquid template language Menu escape\_once ============ Escapes a string without changing existing escaped entities. It doesn’t change strings that don’t have anything to escape. Input {{ "1 < 2 & 3" | escape_once }} Output 1 < 2 & 3 Input {{ "1 < 2 & 3" | escape_once }} Output 1 < 2 & 3 --- # first – Liquid template language Menu first ===== Returns the first item of an array. Input {{ "Ground control to Major Tom." | split: " " | first }} Output Ground Input {% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %} {{ my_array.first }} Output zebra You can use `first` with dot notation when you need to use the filter inside a tag: {% if my_array.first == "zebra" %} Here comes a zebra! {% endif %} --- # join – Liquid template language Menu join ==== Combines the items in an array into a single string using the argument as a separator. Input {% assign beatles = "John, Paul, George, Ringo" | split: ", " %} {{ beatles | join: " and " }} Output John and Paul and George and Ringo --- # floor – Liquid template language Menu floor ===== Rounds an input down to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied. Input {{ 1.2 | floor }} {{ 2.0 | floor }} {{ 183.357 | floor }} Output 1 2 183 Here the input value is a string: Input {{ "3.5" | floor }} Output 3 --- # lstrip – Liquid template language Menu lstrip ====== Removes all whitespace (tabs, spaces, and newlines) from the **left** side of a string. It does not affect spaces between words. Input {{ " So much room for activities " | lstrip }}! Output So much room for activities ! --- # last – Liquid template language Menu last ==== Returns the last item of an array. Input {{ "Ground control to Major Tom." | split: " " | last }} Output Tom. Input {% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %} {{ my_array.last }} Output tiger You can use `last` with dot notation when you need to use the filter inside a tag: {% if my_array.last == "tiger" %} There goes a tiger! {% endif %} --- # map – Liquid template language Menu map === Creates an array of values by extracting the values of a named property from another object. In this example, assume the object `site.pages` contains all the metadata for a website. Using `assign` with the `map` filter creates a variable that contains only the values of the `category` properties of everything in the `site.pages` object. Input {% assign all_categories = site.pages | map: "category" %} {% for item in all_categories %} - {{ item }} {% endfor %} Output - business - celebrities - lifestyle - sports - technology --- # minus – Liquid template language Menu minus ===== Subtracts a number from another number. Input {{ 4 | minus: 2 }} {{ 16 | minus: 4 }} {{ 183.357 | minus: 12 }} Output 2 12 171.357 --- # modulo – Liquid template language Menu modulo ====== Returns the remainder of a division operation. Input {{ 3 | modulo: 2 }} {{ 24 | modulo: 7 }} {{ 183.357 | modulo: 12 }} Output 1 3 3.357 --- # newline_to_br – Liquid template language Menu newline\_to\_br =============== Inserts an HTML line break (`
`) in front of each newline (`\n`) in a string. Input {% capture string_with_newlines %} Hello there {% endcapture %} {{ string_with_newlines | newline_to_br }} Output
Hello
there
--- # remove – Liquid template language Menu remove ====== Removes every occurrence of the specified substring from a string. Input {{ "I strained to see the train through the rain" | remove: "rain" }} Output I sted to see the t through the --- # plus – Liquid template language Menu plus ==== Adds a number to another number. Input {{ 4 | plus: 2 }} {{ 16 | plus: 4 }} {{ 183.357 | plus: 12 }} Output 6 20 195.357 --- # prepend – Liquid template language Menu prepend ======= Adds the specified string to the beginning of another string. Input {{ "apples, oranges, and bananas" | prepend: "Some fruit: " }} Output Some fruit: apples, oranges, and bananas `prepend` can also accept a variable as its argument. Input {% assign url = "example.com" %} {{ "/index.html" | prepend: url }} Output example.com/index.html --- # remove_first – Liquid template language Menu remove\_first ============= Removes only the first occurrence of the specified substring from a string. Input {{ "I strained to see the train through the rain" | remove_first: "rain" }} Output I sted to see the train through the rain --- # replace_first – Liquid template language Menu replace\_first ============== Replaces only the first occurrence of the first argument in a string with the second argument. Input {{ "Take my protein pills and put my helmet on" | replace_first: "my", "your" }} Output Take your protein pills and put my helmet on --- # remove_last – Liquid template language Menu remove\_last ============ Removes only the last occurrence of the specified substring from a string. Input {{ "I strained to see the train through the rain" | remove_last: "rain" }} Output I strained to see the train through the --- # replace – Liquid template language Menu replace ======= Replaces every occurrence of the first argument in a string with the second argument. Input {{ "Take my protein pills and put my helmet on" | replace: "my", "your" }} Output Take your protein pills and put your helmet on --- # replace_last – Liquid template language Menu replace\_last ============= Replaces only the last occurrence of the first argument in a string with the second argument. Input {{ "Take my protein pills and put my helmet on" | replace_last: "my", "your" }} Output Take my protein pills and put your helmet on --- # reverse – Liquid template language Menu reverse ======= Reverses the order of the items in an array. `reverse` cannot reverse a string. Input {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %} {{ my_array | reverse | join: ", " }} Output plums, peaches, oranges, apples Although `reverse` cannot be used directly on a string, you can split a string into an array, reverse the array, and rejoin it by chaining together filters. Input {{ "Ground control to Major Tom." | split: "" | reverse | join: "" }} Output .moT rojaM ot lortnoc dnuorG --- # round – Liquid template language Menu round ===== Rounds a number to the nearest integer or, if a number is passed as an argument, to that number of decimal places. Input {{ 1.2 | round }} {{ 2.7 | round }} {{ 183.357 | round: 2 }} Output 1 3 183.36 --- # rstrip – Liquid template language Menu rstrip ====== Removes all whitespace (tabs, spaces, and newlines) from the **right** side of a string. It does not affect spaces between words. Input {{ " So much room for activities " | rstrip }}! Output So much room for activities! --- # size – Liquid template language Menu size ==== Returns the number of characters in a string or the number of items in an array. Input {{ "Ground control to Major Tom." | size }} Output 28 Input {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %} {{ my_array.size }} Output 4 You can use `size` with dot notation when you need to use the filter inside a tag: {% if site.pages.size > 10 %} This is a big website! {% endif %} --- # slice – Liquid template language Menu slice ===== Returns a substring of one character or series of array items beginning at the index specified by the first argument. An optional second argument specifies the length of the substring or number of array items to be returned. String or array indices are numbered starting from 0. Input {{ "Liquid" | slice: 0 }} Output L Input {{ "Liquid" | slice: 2 }} Output q Input {{ "Liquid" | slice: 2, 5 }} Output quid Here the input value is an array: Input {% assign beatles = "John, Paul, George, Ringo" | split: ", " %} {{ beatles | slice: 1, 2 }} Output PaulGeorge If the first argument is a negative number, the indices are counted from the end of the string. Input {{ "Liquid" | slice: -3, 2 }} Output ui --- # sort – Liquid template language Menu sort ==== Sorts items in an array in case-sensitive order. Input {% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %} {{ my_array | sort | join: ", " }} Output Sally Snake, giraffe, octopus, zebra An optional argument specifies which property of the array’s items to use for sorting. {% assign products_by_price = collection.products | sort: "price" %} {% for product in products_by_price %}

{{ product.title }}

{% endfor %} --- # strip – Liquid template language Menu strip ===== Removes all whitespace (tabs, spaces, and newlines) from both the left and right sides of a string. It does not affect spaces between words. Input {{ " So much room for activities " | strip }}! Output So much room for activities! --- # sort_natural – Liquid template language Menu sort\_natural ============= Sorts items in an array in case-insensitive order. Input {% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %} {{ my_array | sort_natural | join: ", " }} Output giraffe, octopus, Sally Snake, zebra An optional argument specifies which property of the array’s items to use for sorting. {% assign products_by_company = collection.products | sort_natural: "company" %} {% for product in products_by_company %}

{{ product.title }}

{% endfor %} --- # split – Liquid template language Menu split ===== Divides a string into an array using the argument as a separator. `split` is commonly used to convert comma-separated items from a string to an array. Input {% assign beatles = "John, Paul, George, Ringo" | split: ", " %} {% for member in beatles %} {{ member }} {% endfor %} Output John Paul George Ringo --- # strip_html – Liquid template language Menu strip\_html =========== Removes any HTML tags from a string. Input {{ "Have you read Ulysses?" | strip_html }} Output Have you read Ulysses? --- # strip_newlines – Liquid template language Menu strip\_newlines =============== Removes any newline characters (line breaks) from a string. Input {% capture string_with_newlines %} Hello there {% endcapture %} {{ string_with_newlines | strip_newlines }} Output Hellothere --- # times – Liquid template language Menu times ===== Multiplies a number by another number. Input {{ 3 | times: 2 }} {{ 24 | times: 7 }} {{ 183.357 | times: 12 }} Output 6 168 2200.284 --- # sum – Liquid template language Menu sum === Sums all items in an array. If a string is passed as an argument, it sums the property values. In this example, assume the object `collection.products` contains a list of products, and each `product` object has a `quantity` property. Using `assign` with the `sum` filter creates a variable that contains the total quantity for all products in the collection. Input {% assign total_quantity = collection.products | sum: "quantity" %} {{ total_quantity }} Output 6 The `sum` filter also works without any argument. In this example, assume the object `article.ratings` is an array of integers. Using `assign` with the `sum` filter creates a variable that contains the total ratings for the article. Input {% assign total_rating = article.ratings | sum %} {{ total_rating }} Output 6 --- # truncate – Liquid template language Menu truncate ======== Shortens a string down to the number of characters passed as an argument. If the specified number of characters is less than the length of the string, an ellipsis (…) is appended to the string and is included in the character count. Input {{ "Ground control to Major Tom." | truncate: 20 }} Output Ground control to... ### Custom ellipsis `truncate` takes an optional second argument that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (…), but you can specify a different sequence. The length of the second argument counts against the number of characters specified by the first argument. For example, if you want to truncate a string to exactly 10 characters, and use a 3-character ellipsis, use **13** for the first argument of `truncate`, since the ellipsis counts as 3 characters. Input {{ "Ground control to Major Tom." | truncate: 25, ", and so on" }} Output Ground control, and so on ### No ellipsis You can truncate to the exact number of characters specified by the first argument and avoid showing trailing characters by passing a blank string as the second argument. Input {{ "Ground control to Major Tom." | truncate: 20, "" }} Output Ground control to Ma --- # uniq – Liquid template language Menu uniq ==== Removes any duplicate items in an array. Input {% assign my_array = "ants, bugs, bees, bugs, ants" | split: ", " %} {{ my_array | uniq | join: ", " }} Output ants, bugs, bees --- # truncatewords – Liquid template language Menu truncatewords ============= Shortens a string down to the number of words passed as an argument. If the specified number of words is less than the number of words in the string, an ellipsis (…) is appended to the string. Input {{ "Ground control to Major Tom." | truncatewords: 3 }} Output Ground control to... ### Custom ellipsis `truncatewords` takes an optional second argument that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (…), but you can specify a different sequence. Input {{ "Ground control to Major Tom." | truncatewords: 3, "--" }} Output Ground control to-- ### No ellipsis You can avoid showing trailing characters by passing a blank string as the second argument. Input {{ "Ground control to Major Tom." | truncatewords: 3, "" }} Output Ground control to --- # upcase – Liquid template language Menu upcase ====== Makes each character in a string uppercase. It has no effect on strings which are already all uppercase. Input {{ "Parker Moore" | upcase }} Output PARKER MOORE Input {{ "APPLE" | upcase }} Output APPLE --- # url_encode – Liquid template language Menu url\_encode =========== Converts any URL-unsafe characters in a string into percent-encoded characters. Input {{ "john@liquid.com" | url_encode }} Output john%40liquid.com Note that `url_encode` will turn a space into a `+` sign instead of a percent-encoded character. Input {{ "Tetsuro Takara" | url_encode }} Output Tetsuro+Takara --- # url_decode – Liquid template language Menu url\_decode =========== Decodes a string that has been encoded as a URL or by [`url_encode`](https://shopify.github.io/liquid/filters/url_encode/) . Input {{ "%27Stop%21%27+said+Fred" | url_decode }} Output 'Stop!' said Fred --- # where – Liquid template language Menu where ===== Creates an array including only the objects with a given property value, or any [truthy](https://shopify.github.io/liquid/basics/truthy-and-falsy/#truthy) value by default. In this example, assume you have a list of products and you want to show your kitchen products separately. Using `where`, you can create an array containing only the products that have a `"type"` of `"kitchen"`. Input All products: {% for product in products %} - {{ product.title }} {% endfor %} {% assign kitchen_products = products | where: "type", "kitchen" %} Kitchen products: {% for product in kitchen_products %} - {{ product.title }} {% endfor %} Output All products: - Vacuum - Spatula - Television - Garlic press Kitchen products: - Spatula - Garlic press Say instead you have a list of products and you only want to show those that are available to buy. You can `where` with a property name but no target value to include all products with a [truthy](https://shopify.github.io/liquid/basics/truthy-and-falsy/#truthy) `"available"` value. Input All products: {% for product in products %} - {{ product.title }} {% endfor %} {% assign available_products = products | where: "available" %} Available products: {% for product in available_products %} - {{ product.title }} {% endfor %} Output All products: - Coffee mug - Limited edition sneakers - Boring sneakers Available products: - Coffee mug - Boring sneakers The `where` filter can also be used to find a single object in an array when combined with the `first` filter. For example, say you want to show off the shirt in your new fall collection. Input {% assign new_shirt = products | where: "type", "shirt" | first %} Featured product: {{ new_shirt.title }} Output Featured product: Hawaiian print sweater vest --- # Truthy and falsy – Liquid template language Menu Truthy and falsy ================ When a non-boolean [data type](https://shopify.github.io/liquid/basics/types/) is used in a boolean context (such as a conditional tag), Liquid decides whether to evaluate it as `true` or `false`. Data types that return `true` by default are called **truthy**. Data types that return false by default are called **falsy**. Truthy ------ All values in Liquid are truthy except `nil` and `false`. In the example below, the text “Tobi” is not a boolean, but it is truthy in a conditional: {% assign name = "Tobi" %} {% if name %} This text will always appear since "name" is defined. {% endif %} [Strings](https://shopify.github.io/liquid/basics/types/#string) , even when empty, are truthy. The example below will create empty HTML tags if `page.category` exists but is empty: Input {% if page.category %}

{{ page.category }}

{% endif %} Output

Falsy ----- The only values that are falsy in Liquid are [`nil`](https://shopify.github.io/liquid/basics/types/#nil) and [`false`](https://shopify.github.io/liquid/basics/types/#boolean) . Summary ------- The table below summarizes what is truthy or falsy in Liquid. | | truthy | falsy | | --- | --- | --- | | true | • | | | false | | • | | nil | | • | | string | • | | | empty string | • | | | 0 | • | | | integer | • | | | float | • | | | array | • | | | empty array | • | | | page | • | | | EmptyDrop | • | | --- # Operators – Liquid template language Menu Operators ========= Liquid includes many logical and comparison operators. You can use operators to create logic with [control flow](https://shopify.github.io/liquid/tags/control-flow/) tags. Basic operators --------------- | | | | --- | --- | | `==` | equals | | `!=` | does not equal | | `>` | greater than | | `<` | less than | | `>=` | greater than or equal to | | `<=` | less than or equal to | | `or` | logical or | | `and` | logical and | For example: {% if product.title == "Awesome Shoes" %} These shoes are awesome! {% endif %} You can do multiple comparisons in a tag using the `and` and `or` operators: {% if product.type == "Shirt" or product.type == "Shoes" %} This is a shirt or a pair of shoes. {% endif %} contains -------- `contains` checks for the presence of a substring inside a string. {% if product.title contains "Pack" %} This product's title contains the word Pack. {% endif %} `contains` can also check for the presence of a string in an array of strings. {% if product.tags contains "Hello" %} This product has been tagged with "Hello". {% endif %} `contains` can only search strings. You cannot use it to check for an object in an array of objects. Order of operations ------------------- In tags with more than one `and` or `or` operator, operators are checked in order _from right to left_. You cannot change the order of operations using parentheses — parentheses are invalid characters in Liquid and will prevent your tags from working. {% if true or false and false %} This evaluates to true, since the `and` condition is checked first. {% endif %} {% if true and false and false or true %} This evaluates to false, since the tags are checked like this: true and (false and (false or true)) true and (false and true) true and false false {% endif %} --- # Introduction – Liquid template language Menu Introduction ============ Liquid uses a combination of [**objects**](https://shopify.github.io/liquid/basics/introduction/#objects) , [**tags**](https://shopify.github.io/liquid/basics/introduction/#tags) , and [**filters**](https://shopify.github.io/liquid/basics/introduction/#filters) inside **template files** to display dynamic content. Objects ------- **Objects** contain the content that Liquid displays on a page. Objects and variables are displayed when enclosed in double curly braces: `{{` and `}}`. Input {{ page.title }} Output Introduction In this case, Liquid is rendering the content of the `title` property of the `page` object, which contains the text `Introduction`. Tags ---- **Tags** create the logic and control flow for templates. The curly brace percentage delimiters `{%` and `%}` and the text that they surround do not produce any visible output when the template is rendered. This lets you assign variables and create conditions or loops without showing any of the Liquid logic on the page. Input {% if user %} Hello {{ user.name }}! {% endif %} Output Hello Adam! Tags can be categorized into various types: * [Control flow](https://shopify.github.io/liquid/tags/control-flow/) * [Iteration](https://shopify.github.io/liquid/tags/iteration/) * [Template](https://shopify.github.io/liquid/tags/template/) * [Variable assignment](https://shopify.github.io/liquid/tags/variable/) You can read more about each type of tag in their respective sections. Filters ------- **Filters** change the output of a Liquid object or variable. They are used within double curly braces `{{ }}` and [variable assignment](https://shopify.github.io/liquid/tags/variable/) , and are separated by a pipe character `|`. Input {{ "/my/fancy/url" | append: ".html" }} Output /my/fancy/url.html Multiple filters can be used on one output, and are applied from left to right. Input {{ "adam!" | capitalize | prepend: "Hello " }} Output Hello Adam! ---