Shopify platform
Liquid
Liquid is the open-source template language Shopify uses to render storefronts. It sits between your theme files and store data, exposing objects such as `product` and `cart` through tags, filters, and objects that are evaluated server-side. Liquid is intentionally sandboxed — it cannot make network calls or run arbitrary code — which is why heavier logic belongs in an app or a Shopify Function.
Why it matters
Liquid's constraints are the reason Shopify storefronts stay fast and stay up. A template language that cannot make network calls cannot make a product page wait on a slow third-party service, and one that cannot run arbitrary code cannot take a store down with an infinite loop. What reads as a limitation is a guarantee Shopify makes to every merchant on the platform.
For a development team, the practical consequence is that Liquid decides where logic lives. Anything that needs an external system, heavy computation, or state belongs in an app or a Shopify Function, and the theme's job is to render what it is given. Teams that fight this boundary end up with slow storefronts and logic scattered across places nobody can find.
How it works on Shopify
Liquid renders server-side, before the page reaches the browser. Templates combine three constructs: objects that expose store data, tags that control flow and logic, and filters that transform values as they print.
Data access follows the page. A product template receives a product object; a collection template receives a collection and paginated products. Anything outside that scope has to be fetched deliberately, and Liquid's loop limits exist to stop a template from walking the whole catalogue.
Since Online Store 2.0, the important structural files are JSON templates that declare which sections a page uses, with the Liquid living inside those sections. Snippets hold reusable fragments, and schema blocks at the bottom of a section define the settings a merchant sees in the theme editor.
The Storefront and Ajax APIs cover what Liquid cannot: cart updates, predictive search, and anything that must happen after the page has rendered.
Common mistakes
- Querying inside a loop. Fetching a metafield or a related object for every item in a large collection multiplies render time. Resolve data once, outside the loop.
- Rebuilding cart logic in JavaScript. The Ajax cart API exists and handles the edge cases — discount recalculation, inventory checks — that hand-rolled versions get wrong.
- Hardcoding text. Strings baked into Liquid cannot be translated or edited by a merchant. Locale files and section settings exist for this.
- Treating Liquid as private. Rendered output is public HTML. Anything in a template is visible, so nothing sensitive belongs there.
- Deep snippet nesting. Snippets rendering snippets rendering snippets is where theme render times quietly grow, and it is invisible until someone profiles the page.
When you need help
Most Liquid work is ordinary theme development. The point to bring someone in is when the storefront's structure is the problem rather than any single template: render times climbing without an obvious cause, a theme that has drifted so far from its base that upgrades are impossible, or logic that has accumulated in templates because nobody wanted to build an app.
The other case is the boundary decision itself — whether a requirement belongs in Liquid, an app, a Function, or headless. Getting that wrong is not a bug you can fix later; it becomes the shape of the codebase.
Need this done on your store?
Shopify developmentRelated terms
- Shopify themeA Shopify theme is the bundle of Liquid templates, sections, CSS, JavaScript, and settings that controls how a storefront looks and behaves. Themes are versioned separately from store data, so you can duplicate one, edit it safely, and publish when ready. Dawn is Shopify's free reference theme and the baseline most custom builds start from.
- Sections and blocksSections and blocks are the units of a Shopify theme that merchants can rearrange in the theme editor without touching code. A section is a self-contained region of a page — a hero, a product grid — and blocks are the repeatable items inside it. Designing a theme as well-scoped sections is what makes a store editable by a marketing team instead of a developer.
- Online Store 2.0Online Store 2.0 is the 2021 overhaul of Shopify's theme architecture. It introduced sections on every page (not just the homepage), JSON templates, app blocks that merchants can position without editing code, and a much richer metafields system. A theme built before OS 2.0 cannot use these features, which is a common reason to rebuild rather than patch.