schema.json next to its design file. It declares the settings shown in Visual, the blocks a seller can add, and the presets offered in Add section.
src/sections/announcement/schema.json
Section fields
string
required
Name shown in the editor.
string
Group in Add section:
header, footer, hero, products, text, media, social, layout or main.string
A short description of the section.
Setting[]
required
The section’s settings, in panel order. See Setting types.
Block[]
Block types the section accepts. See Blocks and nesting.
number
Most blocks of any type in one section.
boolean
default:"false"
Lets a block sit one level under another block, for example menu dropdowns.
number
Most instances of this section in one template.
string[]
Templates the section can be added to.
page means every custom page. Omit it to allow every template.object
Defaults for the shared style settings:
width, padding_top, padding_bottom, background, background_image, overlay, text_color, radius, animation.Preset[]
Starting points offered in Add section. A section without presets cannot be added from the editor. Use this for main sections such as the product page body.
Presets
A preset sets the name shown in Add section and, optionally, starting settings, style and blocks.blocks.
Setting types
All value settings share these fields:string
required
The setting type below.
string
required
Key in
settings. Lowercase letters, digits and _, starting with a letter. Unique in the section.string
required
Label in the settings panel.
string
Help text under the control.
string | number | boolean
Value used when nothing is stored.
Text
In Liquid, output
richtext and html values with | raw. Everything else is escaped.Media and style
Numbers and choices
Store data pickers
Layout rows
header and paragraph add a heading or a line of text to the settings panel. They hold no value and have no id.
Values in templates
Template files store setting values byid. A missing value uses the schema default. A key that is not a setting, or a value of the wrong kind, is a warning: the storefront ignores it and uses the default. Publish offers Remove unused values to clean these up. See Publish and updates.
