Meridian handbook
Content modellingFields

Fields

The keys every field takes (name, type, label, required, index, translate, visible_when and the rest), field groups, and a table of all 23 field types with links to each type's page.

A field is one entry in a type’s fields: list. Every field has a name and a type; the other keys below are common to all field types, and any key that is not one of them is a parameter of the field type, checked against that type’s parameter list.

fields:
  - name: distanceKm          # the handle templates and the API use
    type: number              # one of the field types below
    label: { en-GB: Distance }
    help: { en-GB: The length of the whole route. }
    required: true            # needed to publish
    index: true               # projected for filtering and sorting
    min: 0.1                  # number parameters
    max: 200
    unit: km

Keys every field takes

KeyTypeDefaultWhat it does
namestringrequiredThe handle: a lowercase letter then letters and digits (distanceKm, heroImage). Unique within its level of the type. Templates read it as entry.<name>.
typestringrequiredA field type from the table below.
idstringwritten by check --fixThe field’s stable id, fld_ and ten characters. Never written by hand; it is what keeps values through a rename.
labellocale map or stringthe nameThe editor’s label.
helplocale map or stringOne line of guidance under the control.
requiredbooleanfalseThe field must have a value to publish. A draft saves without it. See Validation.
required_insource, all, a locale code, or a list of them[source]With required: true, which locales must have the value to publish.
required_whenexpressionRequired to publish when the expression is true (Validation).
visible_whenexpressionShown in the editor only when the expression is true; a hidden field’s value is dropped on save.
recommendedbooleanfalseAdvice only: an empty recommended field blocks nothing and lowers the page’s content health score.
indexbooleanfalseProjects the value into the query index, so lists, smart lists, filters and ordering can filter and sort by it. Inside a repeater or blocks field, a child with index: true is projected under a dotted key (stages.distanceKm).
uniquebooleanfalseNo two documents of the type may hold the same value (per locale for a translated field). Top-level text, slug, number, select, phone and date fields only. A warning on save, an error at publish.
protectedbooleanfalseAny change to the field’s storage (type, translate mode, parameters) or its removal is destructive in a schema plan, even when no document holds a value (Schema changes).
translatenone, locale, language or groupper type, see belowHow many values the field has across locales (Localisation).
translatablebooleanShorthand: true is translate: locale, false is translate: none.
structureshared or per_localesharedRepeater, blocks, link, asset and video fields: whether the item list is shared by every locale or each locale’s own (Localisation).
fallbackempty or inheritemptyOn the public site, what a locale without its own value shows: nothing, or the source locale’s value.
site_overridablebooleanfalseTop-level fields only: a site the document is shared to may hold its own value of this field. Not on slug, not inside a container.
aliaseslist of namesOld handles of a renamed field, still answered by templates and the content API with a warning until retired (Schema changes).
machine_translateallow or forbidallowforbid stops AI drafting a translation of this field. Has no effect without an AI provider.
summary_offield nameOn a top-level text field: AI summarisation drafts it from the named top-level text or portable_text field. Has no effect without an AI provider.
defaultanyRecorded with the field. It is used when an older revision, written before the field existed, is restored. The editor does not prefill it on a new document.
personalbooleanfalseOnly for custom fields of a person record in config/crm/person.yaml (engine-dmo): included in a subject access export and cleared by an erasure. On a document type it fails check.
fieldslistThe child fields of a repeater, or the sub-fields of every link of a link field.
blockslistThe blocks of a blocks field, or the object blocks of a portable_text field.
usefield group nameIncludes a field group instead of declaring a field (Field groups).

A field may sit inside a repeater item or a block; the same keys apply there except site_overridable, unique and summary_of, which are top-level only.

Field types

engine-dmo describe fieldtypes lists these with every parameter; --json gives the same as data. Both bundles have the same field types.

TypeStoresDefault translateProjected with index: truePage
texta stringlocalethe stringText and slug
sluga URL segment, per localelocalethe stringText and slug
numbera numbernonethe numberNumbers and money
moneya decimal amount and an ISO 4217 codenonethe amount, and the code under <name>.currencyNumbers and money
booleantrue or falsenonethe booleanBoolean and select
selectone option, or a list with multiplenoneeach valueBoolean and select
datea calendar daynonethe day at midnight UTCDates and times
datetimea wall-clock time, its IANA zone and the UTC instantnonethe instantDates and times
recurrencea start, duration, zone, repeat rule, extra and removed datesnonenothing; occurrences are materialised separatelyDates and times
geoa latitude, longitude and precisionnonelatitude and longitudePlaces
geo_shapea GeoJSON Polygon or MultiPolygonnonenothing; the bounding box and centroid are kept for containment queriesPlaces
addressa country and its address componentsnonecountry, locality, administrative area, postal code and point, as sub-keysPlaces
phonean E.164 number with its national form and regionnonethe E.164 numberPhone and opening hours
opening_hoursregular hours, seasons, exceptions and holidaysnonewhether any hours are setPhone and opening hours
assetone library asset, or a list with multiple, with per-use framing, alt text and captionlocaleeach asset idAsset
linkone link, or a list with multiple, to a document, asset, URL, email, phone, site or anchorlocalenothing; document and asset targets are tracked as referencesLink
videoa YouTube, Vimeo, library or file video with poster, captions, title and transcriptlocalethe poster and library asset idsVideo
seoa search title and description and their social pairlocalenothingSEO
formone of the site’s form endpoints, by idnonethe endpoint idForm
relationreferences to documents, tags, smart lists, assets, organisations or peoplenoneeach targetRelations
portable_textrich text as Portable TextlocalenothingBlocks and rich text
repeateran ordered list of items with the same child fieldslocalechildren with index: trueBlocks and rich text
blocksan ordered list of items, each one of the declared blockslocalechildren with index: trueBlocks and rich text

There is no file, image, colour, table, duration or daterange field type. Use asset for files and images, and two date or datetime fields with a validation rule for a range.

Field groups

A field group is a named list of fields declared once in config/schema/_shared.yaml and included in any type, repeater or block with - use: <name>:

# config/schema/_shared.yaml
field_groups:
  contact:
    - { name: email, type: text, format: email }
    - { name: phone, type: phone }
# config/schema/venue.yaml
key: venue
label: Venue
fields:
  - { name: title, type: text, required: true }
  - use: contact

The group’s fields become fields of the including type, exactly as if declared there. A group name is camelCase. A use: entry declares nothing else (no name, no type). A group may include another group, but not itself. A variant’s fields cannot use a group.

Ids for a group’s fields are written into _shared.yaml by check --fix, and a field id is unique by declaration, so every type that includes the group shares the same field ids.

Errors you may see

MessageCause
field "<name>" has no idRun engine-dmo check --fix.
field name "<name>" must be camelCase: a lowercase letter then letters and digitsRename it.
field "<name>" is declared twiceTwo entries share a name at the same level.
"<name>" is an engine-managed field and cannot be declaredSee Reserved names.
unknown field type "<type>"The type is not in the table above; the message lists the known types.
field type <type> does not accept a parameter "<key>"A misspelt or unsupported parameter; a close match is suggested.
field type <type> requires the parameter "<key>"select needs options, relation needs to.
field type <type> does not take child fieldsfields: or blocks: on a type that has none.
unique applies to text, slug, number, select, phone and date fields, not <type>Remove unique.
warning: a <type> field is rarely translated; translate: <mode> means one value per <mode>A field whose type defaults to none was given a translate mode; intended only if you really want one value per locale.
unknown field group "<name>"No such group in _shared.yaml.