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.
| Name | Type | Default | Required |
|---|---|---|---|
| string | true | ||
| string | true | ||
| string | |||
| string | |||
| bool | false | ||
| boolean | true | ||
| string | full | ||
| string | |||
| string|array | |||
| string | |||
| string | |||
| string | |||
| boolean | true | ||
| string | |||
| array | |||
| array | |||
| array | |||
| array |
-
- 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: TextCopied!
-
- Type
- string
- Required
true
The field's type. See Field Types.
fields: - identifier: my_identifier type: TextCopied!
-
- 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 labelCopied!
-
- Type
- string
The same as for
labelabove.fields: - identifier: my_identifier type: Text description: Static descriptionCopied!
-
- 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: trueCopied!
-
- 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: falseCopied!Read more about prefixing.
-
- Type
- string
- Default
- full
Determines how to prefix the field if local
prefixor globalField prefixis enabled. Can be eitherFields full(default) orvendor.fields: - identifier: my_identifier type: Text prefixField: true prefixType: vendorCopied!Read more about prefixing.
-
- Type
- string
Defines an alias for the
identifier. This alias is used in Fluid templates and everywhere else you need to access the field value. There is no fallback to the identifier. If set, you have to migrate all existing occurrences to the new alias.fields: - identifier: my_identifier type: Text alias: myAliasIdentifierCopied!
-
- 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
onset toChange reload.
-
- 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
displayis used for this field.Cond onChange: reloadCopied!
-
- Type
- string
Controls how the field behaves in localized records. Possible values are
exclude(the value of the default language record is kept and the field is not shown) andprefix(the value is copied and prefixed with the language title on localization). See l10n_mode.Lang Title fields: - identifier: my_identifier type: Text l10n_mode: excludeCopied!
-
- Type
- string
Controls how the field is displayed in localized records. Possible values are
hide(hides the diff view of the default language value) andDiff default(shows the default language value as read-only). See l10n_display.As Readonly fields: - identifier: my_identifier type: Text l10n_display: defaultAsReadonlyCopied!
-
- Type
- boolean
- Default
- true
If set, backend users can only edit this field if their backend user group explicitly allows it. Content Blocks enables this by default, contrary to TCA, where it defaults to
false. See exclude.fields: - identifier: my_identifier type: Text exclude: falseCopied!
-
- Type
- string
Selects an alternative FormEngine element for the field. Only available for the field types which document it, as core TCA only defines render types for a subset of TCA types. See the TCA types reference for the render types available per TCA type.
fields: - identifier: my_identifier type: Textarea renderType: codeEditorCopied!
-
- Type
- array
Field behaviour options. The most commonly used one is
allow, which lets editors choose between a custom value and the value of the default language record. See allowLanguageSynchronization.Language Synchronization fields: - identifier: my_identifier type: Text behaviour: allowLanguageSynchronization: trueCopied!
-
- Type
- array
Renders informational text directly above the field. See TCA fieldInformation.
-
- Type
- array
Adds buttons next to the field, for example a link or wizard popup. See TCA fieldControl.
-
- Type
- array
Renders additional widgets below the field, for example
defaultorLanguage Differences localization. See TCA fieldWizard.State Selector
Note
render,
behaviour
,
field,
field and
field are only accepted for the
field types whose page lists them. Core TCA evaluates them per TCA type, so
the JSON schema mirrors that restriction.