Skip to main content

ContentModel

In the Type section it is possible to configure the content model of the current property. The content model is the set of types configured to create Contents or Components. Each Content or Component has a well-defined structure in terms of Fields that compose it.

For example, the Content Type "Article" can be configured with the following structure:

  • Title: String type field
  • Slug: String type field
  • Description: Richtext field
  • Image: Image type field

Once the structure of the "Article" content type has been defined, in the Contents section it is possible to create articles that will have exactly this structure. It is important that the structure of the content types and components is known as the frontend obtains these fields via API and must know their structure in order to prepare their presentation on the screen.

The Types that make up the Content Model are created in the CMS > Types section. Once you have chosen the name of the type and specified whether it is a Content (e.g. Article) or a Component (section of a page, e.g. CallToAction), you access a page where you can choose the set of Fields that make up the Type by clicking on one of the Field Types available on the left (String , Richtext, etc.):

Field Types

Deployment

IMPORTANT: once the Content Types have been configured or modified, you must click on the Deploy button so that the changes are visible in the rest of the CMS. Until deployed, the previous configuration remains.

Common Options

After selecting a field type in the left bar, a configuration modal appears. The available options depend on the selected field type. For example, for field type String the following modal appears:

String Field Type

There are a number of options common to (almost) all field types:

  • Settings > API Field Name (required): allows you to specify the name that this field will have in the JSON returned by the API. Yes
  • Settings > Label: allows you to specify the name that this field will have in the Discovery administration backend form. By default, the Field Name API is used, but you can choose a less technical name.
  • Settings > Short Description: allows you to specify a short description (a few words) that must appear under the field in the Discovery administration form. This description can help editors understand what to include in the field, if it is not clear from the name of the field itself.
  • Validation > Required: if selected, the related content/component cannot be published if this field is not filled in.
  • (planned for future releases) Validation > Unique: if checked, this field must contain a unique value. For example, a ProductCode field might have the constraint of being unique.
  • Other > Hide in API: if checked, this field is not made visible via API. However, it can be used for research. Advanced use. IMPORTANT: If this option is changed, the related content must be republished for it to take effect.
  • Other > Available in Listing API: if selected, this field will be returned from the listing API, i.e. the endpoints that retrieve the most results (e.g. getContents()), in order to limit the size of the JSON document returned from the API. getContents() returns only the ID or slug of the filtered content, the title, plus any attributes that were selected with this option. It is advisable to limit the fields returned by the search API to what is strictly necessary, as generally only a few attributes are displayed in the results listing, in order to make searches more efficient. The field, however, will always be visible in the API which returns all attributes starting from the content identifier. This option makes sense in particular for Types of type Content. IMPORTANT: If this option is changed, the related content must be republished for it to take effect.
  • Other > Default Value: for some field types it is possible to specify the default value that this field must have when creating the relevant content/component. IMPORTANT: the default value is applied only to Content/Components that will be created after specifying it. If Content/Components of the type you are configuring have already been created and you set the default value, this will not have retroactive effect.

String

Used for simple string fields, i.e. which do not contain formatting. In addition to the common options, you can indicate:

  • Settings > Number of lines: indicates the number of editor lines on the backend (1 or more)
  • Settings > **Multilang