Loading...
Loading...
Quick reference guide for Shopify Liquid templating. Search, copy, and learn.
83 snippets · press / to search, j/k to navigate
Display a variable value on the page
Create and assign a new variable
Capture rendered content into a variable
Auto-incrementing counter for unique IDs
Conditional rendering with if/elsif/else
Multiple condition branching
Execute when condition is false
Match a value against multiple cases
==, !=, >, <, >=, <=, contains, and, or
Iterate over an array or collection
Slice a loop with limit and offset
Loop metadata: index, first, last, length
Fallback when collection is empty
Alternate between values each iteration
Control loop execution flow
Filter products by tag, vendor, price
Generate an HTML table grid in one tag
Format prices with currency symbols
Responsive images with CDN sizing
upcase, downcase, capitalize, strip, truncate
Convert strings to URL-safe slugs
plus, minus, times, divided_by, round, ceil, floor
Format dates with strftime specifiers
Array transformation filters
first, last, size, reverse, compact, concat
Fallback when value is nil, false, or empty
strip_html, escape, newline_to_br, slice, split
Manipulate color values in Liquid
Get the length of arrays and strings
Localize strings with locale files
Display prices in customer's selected currency
Localize strings using locale files
Core product properties and output
Options, selectors, and selected variant
Inventory levels and badge logic
Access custom metafield data by namespace
Collection data and product grid
Shopping cart items and totals
Logged-in customer data and gating
Global store information
page_title, page_description, canonical_url, Open Graph
Render nav menus from linklists
Current page context and clean URL helpers
SEO-friendly schema.org Product markup
Generate cart recovery links for email campaigns
Show personalized product recommendations
Render custom metaobject entries referenced by a metafield
Render subscription / selling plan options
Render a localized, correctly-ordered address
Access section.settings from the schema
Dynamic merchant-configurable content blocks
Complete .liquid file with schema, blocks, presets
Every available input type reference
Access global settings via the settings object
App & theme blocks with the 2024 section architecture
Add-to-cart form with variant selector
Split large collections across pages
Include snippets with isolated scope
Multi-line logic without repeating delimiters
comment tag and dash-syntax whitespace stripping
Render predictive search results from Shopify API
Boost Core Web Vitals with resource hints
Customer contact form with email, name, and message
Variant color swatches mapped to real colors
Accessible quantity selector with buttons
Add to cart without page reload
Markets localization form for country/currency and language
Embed product videos from media
Render interactive 3D product models
Generate responsive images with multiple sizes
Split products across multiple pages
Display current page and total items
Render sections in templates and layouts
Define section settings and blocks in schema
Load section only when in viewport using Intersection Observer
Inject CSS unique to each section instance
Refresh section content without page reload
Merchant-customizable repeatable blocks
Reusable header/footer groups rendered in the layout
Include snippets with isolated scope and parameters
Legacy snippet inclusion with shared scope