Schema system
Contents
Schemas are the heart of the CMS, enabling you to express your content model as code.
Introduction
Schemas are used to define various editorial elements within the CMS. Schemas may contain a Form which allow you to declare custom data structures. Every schema lives in a namespace that scopes its package and prevents collisions between independent providers.
The available schema kinds are:
-
CMS (Shared configuration and settings)
Schema deployment
Schemas are managed as code, and deployed to Enonic XP via Enonic apps. When an application gets installed, the schemas are registered in the system, and instantly reflected in Content Studio and related APIs.
See the schema packaging and deployment reference in the Enonic Development Kit docs for project layout, build configuration, and registration details.
Descriptor
Schemas are defined using YAML files, and registered with a unique identifier <namespace>:<name> (i.e. "com.example:article")
kind: “ContentType” (1)
title: “Person” (2)
displayNameLabel: “Full Name” (3)
form: [] (4)
| 1 | Kind - i.e. "ContentType", "Mixin" etc. |
| 2 | Title - Human readable schema name. |
| 3 | Configuration - Validated fields for each schema kind |
| 4 | Form - Optional form that declares a custom data structure for the schema. |
Schema localization
You may provide translations for your schemas in multiple languages for better usability in Content Studio.