Best Practices & Tips
Want to use AI to edit your shopify store? Try the Fudge AI Page Builder & Store Editor. Common Objects
Access global Liquid objects like product, collection, shop, and customer. These contain data about the current context. Properties are accessed using dot notation (e.g., product.title). Tags
Liquid tags are used to create dynamic content and control flow in Shopify theme templates. They allow you to add conditional logic, loops, and variable assignments to your template code. Tags are enclosed in {% %} brackets. |
Variable Assignment
Create variables using assign, capture output in variables, or use increment/decrement for counters. Variables are scoped to the template and can be reused throughout. Variable Output
Output variables, strings, numbers, and access object properties and array elements using dot notation or bracket notation. Apply filters to transform values. Template Tags
Include snippets, pass variables to includes, or use render for isolated scope. Use comment tags for multi-line comments or raw tags to prevent Liquid processing. Advanced Filters
Encode/decode base64 and URLs, escape HTML, generate hashes (MD5, SHA1), or output JSON. Use compact to remove nil values and where_exp for complex array filtering. |
String Filters
Transform strings with upcase, downcase, capitalize, split, join, strip, and replace. Use size to get length. These filters are chainable for multiple transformations. Math Filters
Perform mathematical operations on numbers with plus, minus, times, divided_by, and modulo. Use round, ceil, and floor for rounding, or abs for absolute value. Array Filters
Manipulate arrays with sort, reverse, first, last, and map. Filter arrays with where, remove duplicates with uniq, or join arrays with concat. Size returns array length. |
Cheatography
https://cheatography.com
Shopify Liquid Cheat Sheet by jacquesblom
A comprehensive Shopify Liquid cheat sheet covering tags, filters, variables, and best practices for theme development. Includes control flow statements, string manipulation, object references, and template includes.
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets