Conditional Sections
Some sections belong on some products only: a size guide on clothes, a care card on ceramics. Merchants decide that with visibility rules on the section, and a template can make finer, content-level choices itself.
Visibility rules
Rules live on the section, not in its settings, and work for Liquid sections exactly as for built-in ones. The merchant sets them from the section's Visibility panel; there is nothing to declare in your schema.
| Product rule | Operators | Value |
|---|---|---|
| product · collection · tag · vendor · product_type | in · not_in | Lists of ids, handles or names |
| on_sale · in_stock · has_variants | is | true or false |
| price | gt · lt · between | Store currency; between takes [min, max] |
Rules combine with all or any. A device rule shows the section on all devices, mobile only or desktop only. In the editor every section stays visible so it can still be edited; the rules apply on the live store.
Branching inside the template
For decisions about content rather than the whole section, branch on the product, the page type or the editor. In the preview, add or remove apparel from the condition, or switch the route.
| Test | Use it for |
|---|---|
| product.tags contains "…" | Content for a group of products the merchant tags. |
| product.type · product.vendor | Content per type or brand. |
| template.name · request.page_type | A section shared across page types that changes per page. |
| request.design_mode | Hints or placeholders for the merchant that shoppers never see, or keeping an animation still while editing. |
| shop.customer_accounts | Hiding sign-in links on stores without customer accounts. |
Prefer rules for whole sections
Related guides