Template-Specific vs Global Sections
Learn the difference between sections that appear on specific pages and global sections that appear site-wide, plus how to control section availability.
Sections can appear in two contexts: within specific templates or globally across your entire site. Understanding this distinction helps you build flexible, maintainable themes where content appears exactly where it should.
Two Types of Section Placement
Template Sections
These sections are defined within a JSON template and only appear on pages using that template:
{ "sections": { "main": { "type": "main-product" }, "recommendations": { "type": "product-recommendations" } }, "order": ["main", "recommendations"]}The “main-product” and “product-recommendations” sections only appear on product pages. They’re specific to this template.
Global Sections (Section Groups)
Global sections appear on every page. They’re defined in section groups and rendered from theme.liquid:
{# layout/theme.liquid #}<body> {% sections 'header-group' %}
<main> {{ content_for_layout }} </main>
{% sections 'footer-group' %}</body>The header and footer sections appear on every page because they’re rendered at the layout level.
Section Groups
Section groups are JSON files that define which sections appear in a global area:
{ "type": "header-group", "name": "Header", "sections": { "announcement": { "type": "announcement-bar" }, "header": { "type": "header" } }, "order": ["announcement", "header"]}{ "type": "footer-group", "name": "Footer", "sections": { "footer": { "type": "footer" } }, "order": ["footer"]}Merchants can then:
- Reorder sections within the group
- Add new sections to the group
- Customize section settings
- Remove sections (if allowed)
Static vs Dynamic Sections
Static Sections
Static sections are hard-coded in a template or layout. They always appear and cannot be removed by merchants:
{# Hard-coded in a .liquid file #}{% section 'header' %}This header will always render. Merchants can customize its settings but cannot remove it or change its position.
Dynamic Sections
Dynamic sections are defined in JSON templates. Merchants can add, remove, and reorder them:
{ "sections": { "hero": { "type": "hero-banner" }, "featured": { "type": "featured-collection" } }, "order": ["hero", "featured"]}Merchants can:
- Remove the hero section
- Add a new section between hero and featured
- Reorder sections freely
Controlling Section Availability
The presets Property
For a section to be available in the “Add section” menu, it needs a presets array in its schema:
{% schema %}{ "name": "Featured Collection", "settings": [...], "presets": [ { "name": "Featured Collection" } ]}{% endschema %}Without presets, the section can only be used if directly referenced in a template. It won’t appear in the theme editor’s section picker.
Multiple Presets:
You can offer different configurations of the same section:
{% schema %}{ "name": "Image Banner", "settings": [...], "presets": [ { "name": "Image Banner", "settings": { "height": "medium" } }, { "name": "Full-Height Banner", "settings": { "height": "full" } } ]}{% endschema %}Both presets appear in the “Add section” menu with different default settings.
The enabled_on Property
Restrict where a section can be added:
{% schema %}{ "name": "Product Recommendations", "enabled_on": { "templates": ["product"] }, "presets": [ { "name": "Product Recommendations" } ]}{% endschema %}This section only appears in the section picker when editing product templates. It makes no sense on the homepage, so we prevent that.
Enable on Multiple Templates:
{% schema %}{ "name": "Recently Viewed", "enabled_on": { "templates": ["product", "collection", "search"] }}{% endschema %}Enable in Section Groups:
{% schema %}{ "name": "Announcement Bar", "enabled_on": { "groups": ["header"] }}{% endschema %}This section can only be added to the header group, not to any template.
Combine Templates and Groups:
{% schema %}{ "name": "Newsletter", "enabled_on": { "templates": ["index", "collection"], "groups": ["footer"] }}{% endschema %}The disabled_on Property
The opposite of enabled_on. Disable a section in specific contexts:
{% schema %}{ "name": "Featured Collection", "disabled_on": { "templates": ["password"], "groups": ["header", "footer"] }}{% endschema %}This section can be added anywhere except password pages and header/footer groups.
Combining for Precise Control
Use enabled_on when you want to allow only specific places:
{ "enabled_on": { "templates": ["product"] }}// Can ONLY be added to product templatesUse disabled_on when you want to allow most places except a few:
{ "disabled_on": { "groups": ["header"] }}// Can be added anywhere EXCEPT the header groupSection Availability Summary
| Section Has | Available in “Add Section” | Where It Can Be Added |
|---|---|---|
| No presets | No | Only via template JSON |
| presets only | Yes | Anywhere |
| presets + enabled_on | Yes | Only specified places |
| presets + disabled_on | Yes | Everywhere except specified |
Practical Examples
Main Product Section (Template Only)
This section should only exist once per template and shouldn’t be in the “Add section” menu:
{% schema %}{ "name": "Product Information", "tag": "section", "class": "main-product"}{% endschema %}No presets means it can only be placed by the template file itself.
Promotional Banner (Anywhere)
A flexible banner that can go anywhere:
{% schema %}{ "name": "Promotional Banner", "settings": [ { "type": "text", "id": "heading", "label": "Heading" } ], "presets": [ { "name": "Promotional Banner" } ]}{% endschema %}Available everywhere because it has presets with no restrictions.
Header Component (Header Group Only)
A header-specific section:
{% schema %}{ "name": "Header", "enabled_on": { "groups": ["header"] }, "presets": [ { "name": "Header" } ]}{% endschema %}Only available in the header section group.
Product Reviews (Product Pages Only)
{% schema %}{ "name": "Product Reviews", "enabled_on": { "templates": ["product"] }, "presets": [ { "name": "Product Reviews" } ]}{% endschema %}Only makes sense on product pages, so we restrict it.
When to Use Each Approach
Use Template Sections For:
- Page-specific content (product info, collection grid)
- Content that varies by page type
- Sections that need template context (
product,collectionobjects)
Use Global Section Groups For:
- Site-wide elements (header, footer)
- Navigation and branding
- Elements that should be consistent across all pages
Use enabled_on When:
- A section only makes sense on certain page types
- A section requires specific objects (like
product) - You want to prevent misuse
Use disabled_on When:
- A section works almost everywhere
- You need to exclude just a few places
- It’s easier to list exceptions than inclusions
Practice Exercise
Create section schemas for these scenarios:
- A “Size Guide” section only for product pages
- A “Newsletter” section for footer group and homepage
- A “Trust Badges” section available everywhere except header
Solutions:
{# 1. Size Guide - Product only #}{% schema %}{ "name": "Size Guide", "enabled_on": { "templates": ["product"] }, "presets": [ { "name": "Size Guide" } ]}{% endschema %}{# 2. Newsletter - Footer group and homepage #}{% schema %}{ "name": "Newsletter", "enabled_on": { "templates": ["index"], "groups": ["footer"] }, "presets": [ { "name": "Newsletter" } ]}{% endschema %}{# 3. Trust Badges - Everywhere except header #}{% schema %}{ "name": "Trust Badges", "disabled_on": { "groups": ["header"] }, "presets": [ { "name": "Trust Badges" } ]}{% endschema %}Key Takeaways
- Template sections appear on specific page types
- Global sections (via section groups) appear on every page
- Static sections are hard-coded and always render
- Dynamic sections can be added/removed/reordered by merchants
presetsmake a section available in the “Add section” menuenabled_onrestricts where a section can be addeddisabled_onexcludes a section from specific places
What’s Next?
Now that you understand section placement, the next lesson covers Routing and Template Selection to see how Shopify decides which template to render for any given URL.
Finished this lesson?
Mark it complete to track your progress.
Discussion
Loading comments...