Skip to main content
Version: Next

Headless Template Configuration

The content structure of a Headless Document is defined by the template configuration, which defines the layout and the collection of editables to be rendered on the document.

A template configuration needs to be in place before Headless Documents can be created.

Template Configuration

The template configuration is a yaml structure which defines all the editables and their order in the template. In addition to the editables, the configuration also includes the layout type, which defines the layout structure of the editables in the template.

A special editable type Areablock allows to dynamically adds bricks of editables to the document. The functionality is similar to the Areablocks of the default Pimcore documents.

Template Configuration Interface

Template configurations can be applied directly in Admin UI by users with the necessary permissions. The interface allows to add new templates, edit existing ones, and also provides inline help for the configuration of each editable type.

Headless Template Configuration InterfaceHeadless Template Configuration InterfaceHeadless Template Configuration Interface

Simple example template configuration in Symfony configuration file:

pimcore_headless_documents:
templates:
example:
content:
headline:
type: input
config:
placeholder: 'Headline'
required: true

selectTest:
type: select
config:
store:
- ["one-month", "One month"]
- ["three-months", "three-months"]
- ["unlimited", "unlimited"]

mainContent:
type: wysiwyg
config:
height: 200

images:
type: block
items:
image:
type: image