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.

identifier
Required

true

Type

string

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
type
Required

true

Type

string

The field's type. See Field types.

fields:
    identifier: my_identifier
    type: Text
label
Required

false

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
description
Required

false

Type

string

The same as for label above.

fields:
    identifier: my_identifier
    type: Text
    description: Static description
useExistingField
Required

false

Type

bool

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
alternativeSql
Required

false

Type

string (SQL)

It is possible to override the default SQL definition of a field with this option. Not every field type can be overridden. Have a look at the standard SQL definition of the corresponding field.

fields:
    identifier: my_identifier
    type: Text
    alternativeSql: tinyint(2) DEFAULT "0" NOT NULL
prefixField
Required

false

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
prefixType
Required

false

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