Skip to content

schema Tag

The schema tag defines metadata, settings, and block restrictions for templates and blocks. The content is parsed during theme processing but does not render any output.

{% schema %}
{
"name": "identifier",
"settings": [...],
"blocks": [...]
}
{% endschema %}

The schema tag produces no output. It’s processed during theme upload to extract configuration.

Template schemas define custom fields and allowed blocks:

{# templates/event.liquid #}
{% layout 'layouts/default.liquid' %}
{% capture content_for_layout %}
<h1>{{ event.title }}</h1>
{% stageblocks event %}
{% endcapture %}
{% schema %}
{
"name": "event",
"settings": [
{
"type": "upload",
"name": "hero_image",
"label": "Hero Image",
"relationTo": "media"
},
{
"type": "group",
"name": "cta",
"label": "Call to Action",
"fields": [
{ "type": "text", "name": "text", "label": "Button Text" },
{ "type": "text", "name": "url", "label": "Button URL" }
]
}
],
"blocks": [
"accordion",
"content",
"feature-panel",
"image-gallery"
]
}
{% endschema %}
PropertyTypeDescription
namestringTemplate identifier (should match content type)
settingsarrayCustom fields available via [content].theme
blocksarrayAllowed block types (omit to allow all)

Block schemas define the block’s configuration:

{# blocks/hero.liquid #}
<section id="{{ block.id }}" class="hero">
<h1>{{ block.heading }}</h1>
<p>{{ block.subheading }}</p>
</section>
{% schema %}
{
"name": "hero",
"singular": "Hero",
"plural": "Heroes",
"label": "Hero Block",
"settings": [
{
"type": "text",
"name": "heading",
"label": "Heading"
},
{
"type": "text",
"name": "subheading",
"label": "Subheading"
}
]
}
{% endschema %}
PropertyTypeDescription
namestringBlock type identifier
singularstringSingular display name
pluralstringPlural display name
labelstringLabel shown in admin UI
settingsarrayField definitions for the block

Template settings are available via the theme property:

{# In templates/page.liquid #}
{% if page.theme.show_sidebar %}
<aside>{{ page.theme.sidebar_content_html }}</aside>
{% endif %}

Block settings are available directly on the block object:

{# In blocks/hero.liquid #}
<h1>{{ block.heading }}</h1>

The schema tag should be placed at the end of your template or block file, after all other Liquid code.

<section class="hero">
<h1>{{ block.heading }}</h1>
</section>
{% schema %}
{
"name": "hero",
"settings": [...]
}
{% endschema %}