Skip to content

Content Models

Content models define the editable fields for each component type. They determine what editors see in the property panel when editing a component.

Field types

TypeDescriptionEditor UI
textSingle-line stringText input
textareaMulti-line stringTextarea
richtextHTML contentTextarea with HTML
numberNumeric valueNumber input
booleanTrue/falseCheckbox
selectOne of predefined optionsDropdown
colorColor valueColor picker + hex input
imageImage with alt textMedia picker
imagesMultiple imagesMedia picker (multi)
buttonLabel + link pairTwo text inputs
componentsNested child componentsComponent list with CRUD
product-itemsProduct SKU listProduct picker modal
nav-categoriesNavigation mega menu structureNested category editor
footer-columnsFooter column/link structureNested column editor
accordion-itemsCollapsible title/content pairsExpandable item editor
carousel-slidesImage slidesSlide editor
jsonAny JSON valueJSON textarea

Internal title

Every content model must designate one field as the Internal Title. This field is used as the display name in the component list sidebar and for search.

  • Only one field per content model can be the internal title
  • Saving fails if no field is marked as internal title
  • Built-in schemas default to the name field

In the content model editor, check the Internal Title checkbox on the desired field. Checking it on one field automatically unchecks it on all others.

Localizable fields

Each field can be marked as Localizable in the content model editor. Localizable fields store separate values per locale:

{
"title": {
"_localized": true,
"en-US": "Welcome",
"de": "Willkommen"
}
}

Non-localizable fields (like colors, layout options) are shared across all locales.

Some field types are localizable by default: text, textarea, richtext, button, image, images, nav-categories, footer-columns, carousel-slides, accordion-items.

Auto-inferred fields

When a component has data properties that don’t match any field in its content model, the CMS auto-generates editor fields for them in an “Additional Properties” section.

Inference rules:

  • string values become text fields
  • number values become number fields
  • boolean values become boolean fields
  • Objects with desktop/mobile become image fields
  • Objects with label + url/link become button fields
  • Everything else becomes a json textarea

This ensures all data is always editable, even if the content model is incomplete.

Components field type

The components field type supports nested component editing:

  • Add — type picker dropdown with search
  • Edit — click to expand inline, shows all fields from the child component’s content model
  • Delete — remove button per item
  • Reorder — up/down arrows

This is used for Grid items, Scrollable items, and any container component.

Schema resolution

The CMS merges built-in schemas with database content models:

  1. Built-in schemas (hardcoded in shared/schemas/index.ts) provide defaults
  2. Database content models (from the content_models table) override built-ins
  3. The merged result determines what fields appear in the editor

When creating custom components, define the content model in the CMS under Content Models. The editor will automatically render the right field editors.