Models
A Model is a reusable schema. It sets which fields a piece of content can hold, and it holds no data itself.
Where a Model appears
CMS in the sidebar holds Models, and that list shows every Model in the workspace. The list shows the Key below the name, because the key is the value that a schema holds.
Two shortcuts open a filtered subset of the same list. Flows holds Step Layouts, and Pages holds Page Layouts.
Category
A category gives a Model a role. It decides where the Model appears, and what renders an entry that comes from it.
| Category | It gives its shape to | What renders it |
|---|---|---|
| Page layout | A standalone Page. | The SDK renders the entry on your server. |
| Step layout | One Step inside a Flow. | The Step renders the entry in the browser. |
| None (general content) | Content with no layout role. | Nothing renders it directly. A reference field reaches it. |
A Model with no category holds content that other content points at, such as a product or a category. It appears under CMS only.
Field types
A Model is built from fields. Each field has a type. The type decides the editor for the field, and the shape of the value that the field holds.
| Type | Holds | Use it for |
|---|---|---|
| Single line text | A short string. | A title, a label, or a short headline. |
| Multi-line text | A longer plain string. | A description, or a paragraph with no format marks. |
| Markdown | A Markdown string. | Body copy with format marks. |
| Slug | A URL-safe string. | A part of a path, or an identifier. |
| Number | A numeric value. | A price, a count, or a rating. |
| Boolean | A true or false value. | A toggle or a flag. |
| Date | A date value. | A publish date or a deadline. |
| Color | A color value. | A theme accent or a swatch. |
| JSON | Any JSON value. | Structured data with no editor of its own. |
| Group | An object of fields inside the Model. | A set of related fields, held together. |
| Content block | A Block schema inside the Model. | A shared schema fragment that you reuse. |
| Page Sections | A repeatable Content block field, limited to the Section category. | The section list of a page. |
| Reference | A pointer at another content entry. | A product that points at its category. |
| Asset | A link to an Asset Library item. | An image, a video, or a document. |
| HTML | A link to a .html file in your library. | HTML that you wrote before, held inside the content. |
Reference fields
A Reference field points at another content entry. The entry that you point at keeps its own data, and many fields can point at the same entry.
| Option | Values | What it does |
|---|---|---|
| Target Model | A Model, or Any Model | Limits which entries an editor can choose. |
| Repeatable | On or off | On gives an ordered list of entries. Off gives one entry. |
Target Model holds the key of the Model, and not its id. A duplicate of the
workspace therefore keeps the constraint.
A reference stays inside one workspace. A field cannot point at an entry in another workspace, and Picked reports such a target as unknown.
Repeatable and grouped fields
You can make any field repeatable. It then shows as a sortable list of values, and not as one value. Use it for a gallery, for a list of features, or for any collection.
A Group field holds a set of fields under one key, and it gives a structured object. Make a group repeatable to describe a list of objects, such as a list of feature cards.
Delete rules
Picked does not delete a Model while something still needs it.
| Condition | Result |
|---|---|
| Content entries still belong to the Model | The delete stops. |
| A Reference field still holds the Model as its Target Model | The delete stops. |
Related
- About the content model — why a schema change does not migrate your data.
- About content references — why a reference is a pointer.
- How to define a page layout
- How to create a content entry
- How to point one entry at another
- Blocks
