Blueprints
Each kind of content is a JSON blueprint: its fields, how the client's form is laid out, and where its pages live.
One file per kind of content, named after its handle: blueprints/office.json has "handle": "office". The client panel builds its forms from these files.
{
"version": 1,
"handle": "office",
"label": "Offices",
"singular": "office",
"nestable": true,
"prefix": "offices",
"seo": { "descriptionFrom": "intro", "imageFrom": "photo" },
"fields": [
{ "name": "title", "type": "text", "label": "Office name", "required": true },
{ "name": "intro", "type": "textarea", "maxLength": 300 },
{ "type": "tabs", "tabs": [
{ "label": "Details", "fields": [
{ "name": "address", "type": "textarea", "required": true },
{ "name": "phone", "type": "text" },
{ "name": "photo", "type": "media", "accept": ["image"] }
]},
{ "label": "Team", "fields": [
{ "name": "people", "type": "relation", "to": "person", "many": true }
]}
]}
]
}
A field named title is the entry's title: what the panel lists it by. Without one, entryLabel builds it, for example "{last_name}, {first_name}".
Field types
text,textarea: withplaceholder,maxLength,default(andprefix/suffixfor text)richtext: limited HTML, withtoolsfromheading,bold,italic,list,link. Headings become<h3>number:min,max,step,prefix,suffixboolean,date,select(withoptionsand optionalmultiple)media: images or documents, stored with alt text and the client's focal pointrelation: links to entries of another blueprint, withmanyandmaxrepeater: a list of rows, withnoun,summary,minandmax(up to 50)
Every field also takes label, required, help and visibleWhen.
Repeater or blueprint?
If it needs its own page, needs filtering or sorting across entries, or could grow past a few dozen rows, it's a blueprint with a relation. Team members are people (a blueprint) linked from an office; opening hours are a repeater. Relations can't go inside a repeater.
Laying out the form
Containers arrange fields without changing the data: section, fieldset, tabs and columns (2 to 4, stacking on narrow screens). A field's name is unique across the whole entry however deeply it's nested.
Show a field only sometimes with visibleWhen, using equals, notEquals, in, filled or empty. A hidden field isn't saved.
{ "name": "office", "type": "relation", "to": "office",
"visibleWhen": { "field": "is_remote", "equals": false } }
Where each one lives
- A top-level page: no keys needed.
/jane-smith/ - A pattern:
"route": "/team/{slug}"gives/team/jane-smith/ - Pages inside pages:
"nestable": true, with an optionalprefixandparentTypes./offices/cardiff/bay/ - Just one, at one address:
"singleton": truewith aroute, such as the homepage at/or a pricing page
Give one-off singletons "listIn": "page" so the client finds them in their Pages list, marked "Own layout", rather than as a separate item in the sidebar.
Choose names carefully
Templates read fields by name. Renaming a field later leaves saved values under the old name, so settle names before the client starts adding content.
Other blueprint keys
listColumns: a few top-level fields shown as columns in the panel's listsortable: the client orders entries by dragging (flat lists only)seoandschema: see SEO, analytics and cookiessuggestions: lets a news or blog blueprint receive suggested posts as drafts for review