Understanding how Content Editor interprets content definitions

November 14, 2023

Content Editor is an application that users use to create and publish content. Jahia includes default content types and you can also create your own. You can also personalize the content types that are available to users in Content Editor.

This topic shows developers how a content definition is interpreted by Content Editor and how the content type specified in the definition displays to users.

Note: For more information about Content Editor, see Using Content Editor.

How content types display in Content Editor

Note: For more information on content types, see Understanding content types.

You define content types by editing the definitions.cnd file. The definition.cnd file defines the Content Editor user interface for each content type. For example, the following code defines the default jnt:news content type.

[jnt:news] > jnt:content, mix:title, jmix:editorialContent, jmix:structuredContent
- jcr:title (string) i18n mandatory
- desc (string, richtext) i18n
- image (weakreference, picker[type='image'])
- date (date) = now()

The content definition inherits the jnt:content type and has three mixins: mix:title, jmix:editorialContent and jmix:structuredContent. Each of the four properties, jcr:title, desc, image and date, displays as a field in Content Editor.

  • The title property is a string that displays as a mandatory input text field
  • The desc property is a string with a rich text value that displays a rich text field that uses the CKEditor
  • The image property is a weakreference with a picker of image type that displays a clickable field that allows you to select an image
  • The date property is a date that displays a date picker

The following image shows how to content type renders in Content Editor.

news-entry.png

In your definitions.cnd file, you can also add a:

  • Section to a Content Editor form by defining an itemType
  • Fieldset (a group of fields) in a Content Editor form by defining a mixin that includes properties