Filters are a way of manipulating output. You start off with a value and chain as many filters as you want with the "|" (pipe) delimiter.
{{ '/' | home_url }}
/mystore
{{ '/contact' | home_url }}
/mystore/contact
{{ 'script.js' | resource_url }}
{{ 'less.js' | global_url }}
{{ 'capitalize me' | capitalize }}
Capitalize Me
{{ 'uppercase me' | uppercase }}
UPPERCASE ME
{{ 'LOWERCASE ME' | lowercase }}
lowercase me
{{ 'This would be my 10!' | to_url }}
this-would-be-my-10
{{ 1 | plural: 'item', 'items' }}
item
{{ 3 | plural: 'item', 'items' }}
items
{{ cart.item_count | plural: 'item', 'items' }}
item if the cart has one item and items if the cart has more than one item
{{ 1 | money }}
1.00 EUR
{{ 2 | money: 3 }}
2.000 EUR
{{ 'script.js' | script_tag }}
<script src="script.js" type="text/javascript"></script>
{{ 'script.js' | resource_url | script_tag }}
<script src="URL_TO_YOUR_script.js_RESOURCE" type="text/javascript"></script>
{{ 'style.css' | stylesheet_tag }}
<link rel="stylesheet" type="text/css" href="style.css" />
{{ 'style.css' | resource_url | stylesheet_tag }}
<link rel="stylesheet" type="text/css" href="URL_TO_YOUR_style.css_RESOURCE" />
{{ product | product_url }}
/mystore/product/PRODUCT_HANDLE_OR_ID
{{ product.id | product_url }}
/mystore/product/PRODUCT_ID
{{ product.handle | product_url }}
/mystore/product/PRODUCT_HANDLE
{{ collection | collection_url }}
/mystore/collection/COLLECTION_HANDLE
{{ use_layout alternate }}
Uses alternate.liquid layout instead of default.liquid
{% include '/snippets/search.liquid' %}
Will include the snippet search.liquid
{% include '/snippets/categories.liquid' param:collection %}
Will include the template categories.liquid in which the variable param will be passed the value of collection
Blog • Privacy Policy • Terms & Conditions • Copyright 2024 Ticket Rewards