Introduction to Content Modelling

Correctly modelling the structure of your content is one of the most important aspects of successfully integrating with a headless CMS. If you’re not sure what a content model is, please see the core concepts section.

Defining a Content Model

Each space has its own content model which can be found in the space’s “Content Model” section.

The default and recommended way to manage your space’s content model is using the visual editor, though users who wish to do so can edit the model manually using the YAML editor.

To enter the YAML editor, navigate to the “Content Model” section of your space, and click on the “Switch to YAML Editor” button.

Content Types

Most content models will consist mainly of content type definitions. As explained in the core concepts section, content types are the main building blocks for your content.

The table below shows what a content type configuration looks like:

Name Type Required Description
id String Yes A unique identifier for your content type. Allowed characters are upper/lowercase alphanumeric, underscores and hyphens.
name String Yes A human readable name for your content type.
component Boolean No Specifies whether or not this content type is a component. Defaults to false
fields [ContentField] Yes An array of content fields.

Content Fields

Content fields are the pieces that define the data which can be stored in a particular content type. Each content field can be any one of the supported field types.

The table below shows what a content field configuration looks like:

Name Type Required Description
id String Yes A unique identifier for your content field. Allowed characters are upper/lowercase alphanumeric, underscores and hyphens.
name String Yes A human readable name for your content field.
description String No A description for your content field which can be displayed in the content editing UI.
required Boolean No Specify whether the content field is required or not. Defaults to false.
l10n ContentFieldL10n No Specify the localisation configuration for this field.
config ContentFieldConfig Yes Specify the field type as well as any field type specific configuration. For field type specific configuration options, see supported field types.

Content Field / L10n

The table below shows what the configuration of a content fields l10n attribute looks like:

Name Type Required Description
enabled Boolean No Specify whether or not localisation is enabled on this field. Defaults to true.
fallback Boolean No Specify whether or not the field should use any configured locale fallbacks. Defaults to true.

Content Field / Config

The table below shows what the configuration of a content fields config attribute looks like. In addition to the below options, you can also provide further options which are specific to the particular type of field that is being defined.

Details of these additional options can be found on the supported field types page.

Name Type Required Description
type String Yes Specify the field type for the content field.

Locales

As described in the core concepts section, locales allow you to define the languages that your content can be translated into.

When defining a locale you can also specify a fallback. This allows you to define an alternative locale which should be used in the event that a piece of content is not available in this locale. For example, you could specify that the French locale should fallback to using the English locales content in the event that no French translation has been provided for a piece of content.

The table below shows what a locale configuration looks like:

Name Type Required Description
code String Yes A code which can be used to identify the locale. Example: “en-GB”.
name String Yes A human readable name for the locale.
fallback String No Specify the code for the for the locale that content should fallback to using if content for this locale is unavailable.

Example Content Model

Below is an example of a simple content model which defines a single locale and a single content type.

l10n:
  defaultLocale: en-GB
  locales:
    - { code: en-GB, name: English }

contentTypes:
  - id: article
    name: Article
    fields:
      - id: title
        name: Title
        config: { type: text }
      - id: body
        name: Body
        config: { type: textLong }
Integrates with your favourite tools and frameworks

© 2022 Status200 Ltd.