Field types

The Content Block field types mirror the available TCA types. Some types have been renamed to better reflect the actual usage. For the most part options are identical. There are some additional options, which are not available in TCA to ease the usage.

Common field options

Field options, which can be defined inside the fields array.

Name Type Default Required
string true
string true
string
string
bool false
boolean true
string full
string|array
string

identifier

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.

fields:
    identifier: my_identifier
    type: Text
Copied!

type

type
Type
string
Required

true

The field's type. See Field types.

fields:
    identifier: my_identifier
    type: Text
Copied!

label

label
Type
string

By default labels should be defined inside the labels.xlf 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.

fields:
    identifier: my_identifier
    type: Text
    label: Static label
Copied!

description

description
Type
string

The same as for label above.

fields:
    identifier: my_identifier
    type: Text
    description: Static description
Copied!

useExistingField

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

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!

prefixType

prefixType
Type
string
Default
full

Determines how to prefix the field if local prefixField or global prefixFields is enabled. Can be either full (default) or vendor.

fields:
    identifier: my_identifier
    type: Text
    prefixField: true
    prefixType: vendor
Copied!

displayCond

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!

onChange

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 displayCond is used for this field.

onChange: reload
Copied!