Content Types

Content type is a generic term indicating a definition of a class of content items. Document types and FieldGroup types are all content types.

A document type defines the data structure and the editing template of a class of documents. A document type can contain both primitive and fieldgroup type fields. A fieldgroup type defines the data structure and the editing template of a reusable block of document fields. A fieldgroup type can contain both primitive and fieldgroup type fields. An instance of a fieldgroup type can only exist within a document instance.

Below you can see the properties of document and fieldgroup types.

Property Name

Property Type

Required

Description

Examples

name

String

yes

The name of the document of fieldgroup type.

Banner, TitleAndText, NewsArticle

type

String

yes

Type of the content type. Valid values: 'Document', 'FieldGroup'.

enabled

Boolean

no

It defines whether the content type is enabled or not. The default value is true. When a content type is disabled, it is not selectable in document type dropdown while creating a document from the content editor or a page from the experience manager. Also a disabled field group type is not assignable in a document type or a channel component.

true

fields

Array of fields

yes

Array of fields of this document or fieldgroup type. See Content Type Fields.

presentation/layout

String

yes

Layout specification for the fields of the document or fieldgroup type. Valid values:

'one-column' (all fields vertically in one column)
'two-column' (fields split in 2 columns, left column is wide, right is narrow)
'three-column' (fields split in 3 columns)
'horizontal' (all fields in one row)
'two-column-mirrored' (same a two-column but left column is narrow, right is wider).

The ‘layoutColumn’ property on the field sets in which column the field takes place. The order of the fields in a column is determined by the index of fields in the "fields" attribute.

two-column, one-column

An example document type can be seen below:

{
  "name": "example",
  "type": "Document",
  "enabled": true,
  "fields": [
    {
      "name": "stringField",
      "required": true,
      "multiple": true,
      "type": "String",
      "defaultValue": [
        "Blogtitle1",
        "Blogtitle2"
      ],
      "validations": {
        "maxLength": 10
      },
      "presentation": {
        "caption": "Title",
        "hint": "Hint for string field",
        "layoutColumn": 1,
        "displayType": "Simple"
      }
    },
    {
      "name": "dateField",
      "required": true,
      "type": "Date",
      "defaultValue": [
        "2007-12-03T10:15:30.00Z"
      ],
      "presentation": {
        "caption": "Date Field",
        "hint": "Hint for date field",
        "layoutColumn": 2,
        "timeSelectable": true
      }
    }
  ],
  "presentation": {
    "layout": "two-column"
  }
}