Overview
Sections are HTML files that let you create reusable content modules, which merchants can adjust. They can also include blocks that let merchants add, remove, and reorder section content.
For example, you can create a section with an image and text side by side, giving merchants options to choose the image, set the text, and select the display order.
You can use JSON templates to dynamically add sections to a page, giving merchants flexibility in customizing the page layout. Sections in JSON templates can support App Blocks, letting merchants include app content without editing the theme code. JSON templates can show up to 25 sections, and each section can have up to 16 blocks.
You can also render static sections, giving merchants options for static content customization.
By default, any template can use sections, but you can limit which templates can access them in the section schema.
The diagram below shows the main theme template structure, highlighting sections in blue and blocks in red:

Location
Section files are in the theme's sections folder:
└── theme
...
├── sections
├── templates
...
Content
Sections can include two main types of content:
| Type | Description | Required |
|---|---|---|
| Main Content | Any HTML or Handlebars content you want to include in the section. Like other Handlebars theme files, sections have the same access to global objects, HTML tags, and Handlebars helpers. - section object - Contains the section's properties and settings values- block object - Contains the properties and settings values for individual section blocksIn addition to global objects, variables created outside a section are not accessible within the section. Section and block objects, as well as variables created within a section, are not available outside their respective sections. The only exception is when you reference snippets that contain section and block objects, as snippets are rendered within the section you reference. | No |
| Assets | Sections can bundle their JavaScript and CSS assets with the following helpers: - asset_url | No |
| Schema | Sections support specific {{#schema}} Handlebars tags for defining section properties and settings, detailed in Section schema | Yes |
Usage
When handling sections, you should be familiar with the following:
Rendering Sections
You can render a section in the following ways:
- Using sections in JSON templates
- Using the
section helperto statically render sections
To render sections in a template, use JSON templates. JSON templates give merchants more customization options and improve theme editor performance.
Statically Render a Section
You can use the Handlebars section helper to statically render sections.
For example, if you have a /sections/header.html file containing your theme's header content, you might want to include that section in theme.html to render the header on all pages using that layout.
{{ section 'header' }}
You can include statically rendered sections in multiple theme files. However, the section only exists as one instance. If you change the section settings in one place, the changes apply everywhere.
Integrating Sections with the Theme Editor
When merchants customize sections through the theme editor, the HTML for those sections is dynamically added, removed, or re-rendered in the existing DOM without reloading the entire page. However, any associated JavaScript that runs on page load will not run again.
You must ensure that a section or block becomes visible and stays visible when selected. For example, a carousel section should scroll into view when selected and slide to the selected block (carousel item), pausing the carousel when that block is chosen.
To identify theme editor actions, such as section and block selection or reordering, you can use the JavaScript events emitted by the theme editor.
You might also want to prevent certain code from running in the theme editor. You can use Handlebars and JavaScript variables to detect the theme editor.
Section files must define presets in their schema to support adding them to JSON templates using the theme editor. Sections without presets should be manually included in the JSON file and cannot be removed using the theme editor.
Supporting App Blocks
App blocks let app developers create blocks for merchants to add app content to their themes without directly editing theme code. To learn more about making your theme compatible with App Blocks, see App Blocks.