A section group is a JSON data file that stores a list of [sections](/docs/storefronts/themes/architecture/sections) and [app blocks](/docs/storefronts/themes/architecture/blocks/app-blocks) to be rendered, and their associated settings. Merchants can add sections to the section group, as well as remove and reorder them, in the theme editor. You can [add a reference to a section group](#include-a-section-group-in-a-layout-file) in a [layout](/docs/storefronts/themes/architecture/layouts) file to add support for sections in areas that are controlled by the layout, such as the header or footer. The sections and app blocks referenced in a section group are rendered in the order specified by the `order` attribute, with no markup between the sections. Section groups can render up to 25 sections, and each section can have up to 50 blocks. The sections and app blocks referenced in section groups are the same sections and app blocks referenced in templates, and should follow the same [guidelines](/docs/storefronts/themes/best-practices/templates-sections-blocks). You can use section groups in place of [static sections](/docs/storefronts/themes/architecture/sections#statically-render-a-section) in layouts. [Learn how to migrate from static sections to section groups](/docs/storefronts/themes/architecture/section-groups/migrate). > Tip: > In most themes, you should use section groups for only the header and footer. If you create additional section groups for other areas of the theme, such as a navigation sidebar, then name the section group to reflect its intended purpose. ## Location Section group files are located in the `sections` directory of the theme: ```text └─ theme ... ├─ layout │ └─ theme.liquid ├─ sections │ ├─ footer-group.json │ ├─ header.liquid │ ├─ header-group.json │ └─ ... ... ``` ## Schema Section groups must be valid JSON files. The root should be an object with the following attributes:
Attribute | Type | Required | Description |
---|---|---|---|
type |
String | Yes |
The type of the section group. Accepted values:
|
name |
String | Yes |
A name for the section group. Maximum length: 50 characters |
sections |
Object | Yes |
An object that uses section IDs as keys, and section data as values. You can leave this attribute empty. Duplicate IDs within the template aren't allowed. The format of the section data is the same as the section data in settings_data.json. JSON templates can render up to 25 sections, and each section can have up to 50 blocks. |
order |
Array | Yes |
An array of section IDs, listed in the order that they should be rendered. The IDs must exist in the sections object. You can leave this attribute empty. Duplicate IDs aren't allowed.
|
Value | Type | Required | Description |
---|---|---|---|
<SectionID> |
String | - | A unique ID for the section. Accepts only alphanumeric characters. |
<SectionType> |
String | Yes | The filename of the section file to render, without the extension. |
<SectionDisabled> |
Boolean | No | When true , the section isn't rendered but can still be customized in the theme editor. Is false by default. |
<BlockID> |
String | - | A unique ID for the block. Accepts only alphanumeric characters. |
<BlockType> |
String | Yes | The type of block to render, as defined in the schema of the section file. |
<BlockOrder> |
Array | No | An array of block IDs, ordered as they should be rendered. The IDs must exist in the blocks object, and duplicate IDs aren't allowed. |
<SettingID> |
String | - | The ID of a setting as defined in the schema of the section or the block. |
<SettingValue> |
(multiple) | - | A valid value for the setting. |