Field Types
These are the Content Blocks Field Types, which you can use out of the box. They cover mostly basic types. Custom Field Types can be developed from scratch. More semantic field types may be added over time.
If you are familiar with TCA types, then you will probably recognize most of these types. Some types have been renamed for better clarity.
Note
The documented field options here are not complete. You are allowed to use every option, which you can also find in the TCA documentation. Have a look at the TCA type mapping if you are unsure, which field type is the counterpart to the TCA type.
Simple Field Types:
Relational Field Types:
Structural Field Types:
Special field types:
Common field options
Field options, which can be defined inside the fields
array.
identifier
-
- Type
- string
- Required
true
The field's identifier has to be unique within a Content Block. Exception is within a collections' field array, as this starts a new scope.
Warning
Avoid using dashes "-" inside your identifiers. They are not guaranteed to be escaped in the database. We recommend to always use snake case.
fields: identifier: my_identifier type: Text
Copied!
type
-
- Type
- string
- Required
true
The field's type. See Field Types.
fields: identifier: my_identifier type: Text
Copied!
label
-
- Type
- string
By default labels should be defined inside the
labels.
file. But in case there is only one language for the backend you may define labels directly in the YAML configuration. Translation files have precedence over this.xlf fields: identifier: my_identifier type: Text label: Static label
Copied!
description
-
- Type
- string
The same as for
label
above.fields: identifier: my_identifier type: Text description: Static description
Copied!
useExistingField
-
- Type
- bool
- Default
- false
If set to true, the identifier is treated as an existing field from the Core or your own defined field in TCA. To learn more about reusing fields read this article.
fields: identifier: bodytext useExistingField: true
Copied!
prefixField
-
- Type
- boolean
- Default
- true
If set to false, the prefixing is disabled for this field. This overrules the global option prefixFields.
fields: identifier: my_identifier type: Text prefixField: false
Copied!Read more about prefixing.
prefixType
-
- Type
- string
- Default
- full
Determines how to prefix the field if local
prefix
or globalField prefix
is enabled. Can be eitherFields full
(default) orvendor
.fields: identifier: my_identifier type: Text prefixField: true prefixType: vendor
Copied!Read more about prefixing.
displayCond
-
- Type
- string|array
Can be used to display the field only under certain conditions. Please have a look at the official documentation for more information.
# Simple, only one rule. displayCond: 'FIELD:identifier:=:value'
Copied!# Multiple rules combined with AND. displayCond: AND: - 'FIELD:identifier:=:value' - 'FIELD:another_identifier:=:1'
Copied!Tip
Fields used in a condition should have the column option
on
set toChange reload
.
onChange
-
- Type
- string
Can be used to trigger a reload of the Content Type when this specific field is changed. Should be used, if a rule of
display
is used for this field.Cond onChange: reload
Copied!