section { } and block { } grammar belongs to Slurp. See
Sections and blocks for the schema, the
setting kinds and merge semantics. This page covers the ByteSell layer: default
content, global zones, and the conditions under which a merchant’s block
renders.
Default content
templates/<page key>.json supplies the content a store starts with when the
theme is installed. From then on the merchant owns the content and the file is
not consulted again.
site/templates/index.json
A duplicate
id within one page fails the publish. The editor addresses a
section as (page, id), so a repeat makes both unreachable. The same id on two
different pages is permitted.
Global zones
A named group hosts chrome shared across pages. Place it in a layout:site/layouts/base.slurp
templates/groups/header.json creates a zone named header, which
{sections "header"} renders.
site/templates/groups/header.json
The page’s own
{sections} is stripped on entry to a component or layout, so
it resolves only in a page. Named groups are not stripped, so a layout can
compose them. Put {sections} in the page and {sections "header"} in the
layout.Block rendering rules
Both of the following fail silently.A section targeting @theme must host {blocks}
@theme makes the merge accept every theme block type. If the markup then draws
children by hand, the merge accepts a type the markup never draws: the
merchant’s block persists in the database and the page renders without it.
@theme, or it advertises types it cannot render.
A theme block cannot use {fetch}
Publishing rejects any file under blocks/ containing a {fetch} at any depth:
Files under blocks/
- The block type is the filename, not the schema’s
name.nameis the label in the merchant’s palette. - Filenames are restricted to
[A-Za-z0-9_-].blocks/a/b.slurpis ignored: the renderer rejects the/, so the block would be addable but never render. - A file under
blocks/with noblock { }schema is ignored rather than rejected, so partials can live there.