Skip to main content

A component determines a reusable schema added to content types which entries are then created from. Components contain a list of fields just like content types, and allow for a standardized schema for modelling content.

Properties

Name Type Format Description
id string A unique component identifier
projectId string The project identifier, e.g. "movieDb". Found in the project overview screen of the management console
name object Localized value The friendly name given to a component
description object Localized value The description text given to a component
fields object […] Field A collection of fields that form the schema for an entry
workflowId string The workflow process that derived entries will follow.
dataFormat string Either entry or asset
version object Version Version information about the component

Field

The field object is the definition of a field within an entry. The field also contains the validations and editor configuration that is used within the Contensis UI and services.

Properties

Name Type Format Description
id string A unique field identifier
name object Localized value A friendly name for the field
description object Localized value The description for the field's purpose
dataType string Data type The field data type
dataFormat string Data type The field data format
default object Localized value The default value for the field if no value is provided by an editor
validations object The validations that will be performed on the field when the entry is either created or updated
editor object Editor Configuration for the Contensis entry editor

Localized value

A localized value is an object that has values that are keyed by language codes which allows multilingual variations of a specific property.

Example

JSON
{
  "id": "movieRole",
  "projectId": "website",
  "name": {
    "en-GB": "Movie Role"
  },
  "description": {
    "en-GB": "A Persons role within a movie"
  },
  "fields": [
    {
        "id": "person",
        "name": {
        "en-GB": "Person"
        },
        "dataType": "object",
        "dataFormat": "entry",
        "description": {
            "en-GB": "The actor or crew member"
        },
        "default": {},
        "validations": {
            "allowedContentTypes": {
                "contentTypes": ["person"]
            }
        },
        "editor": {
            "id": "entry",
            "instructions": {
                "en-GB": ""
            },
            "properties": {
                "placeholderText": {
                    "en-GB": ""
                }
            }
        }
    },
    {
      "id": "role",
      "name": {
        "en-GB": "Role"
      },
      "dataType": "String",
      "dataFormat": null,
      "description": {},
      "default": {},
      "validations": null,
      "editor": null
    }  
  ],
  "workflowId": "ContensisDefault",
  "dataFormat": "component",
  "version": {
        "createdBy": "s.derrickson",
        "created": "2016-10-12T09:29:18.5144641+01:00",
        "modifiedBy": "b.cumberbatch",
        "modified": "2016-10-13T10:15:12.1973648+01:00",
        "publishedBy": "b.cumberbatch",
        "published": "2016-10-13T10:15:12.1973648+01:00",
        "versionNo": "2.0"
    }
}

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request