config.yaml
The heart of a Content Block is the config.yaml file. This YAML file defines both the available fields and the structure:
name: vendor/content-block-name
fields:
- identifier: header
useExistingField: true
- identifier: my_text_field
type: Text
max: 10
First of all, a
name
has to be defined. It must be unique inside your
installation. It consists, similarly to composer package names, of a vendor and
a package part separated by a slash. It is used to prefix new field names, new
tables and record type identifiers.
Inside
fields
you define the structure and configuration of the
necessary fields. The
identifier
has to be unique per Content Block.
It is possible to reuse existing fields with the flag
use
.
This allows e.g. to use the same field
header
or
bodytext
across
multiple Content Blocks with different configuration. Be aware that system
fields shouldn't be reused. A list of sane reusable fields can be referenced in
the documentation. Furthermore, own custom fields can be reused as well.
- Refer to the YAML reference for a complete overview.
- Learn more about reusing fields
- For more information about the YAML syntax refer to YAML RFC