The "columns" section contains configuration for each table field (also called "column") which can be edited by the backend.
The configuration includes both properties for the display in the backend as well as the processing of the submitted data.
Each field can be configured as a certain "type" (e.g. checkbox, selector, input field, text area, file or db-relation field, user defined etc.) and for each type a separate set of additional properties applies. These properties are clearly explained below for each type.
This reference below shows the keys of the
['columns'][field name] array.
string or LLL reference
The name of the field as it is shown in the interface:
Labels can be overridden in the types definition.
If set, all backend users are prevented from editing the field unless they are members of a backend user group with this field added as an "Allowed Excludefield" (or "admin" user).
See Inside TYPO3 for more about permissions.
Only active if the [ctrl] "languageField" property is set.
The main relevance is when a record is localized by an API call in DataHandler that makes a copy of the default language record. You can think of this process as copying all fields from the source record, except if a special mode applies as defined below:
- exclude – Field will not be shown in TCEforms if this record is a localization of the default language. (Works basically like a display condition.) Excluded fields will not be copied when a language-copy is made. May have frontend implications.
- prefixLangTitle – The field will get copied, but the content is prefixed with the title of the language. Works only for field types like "text" and "input"
As mentioned above if "l10n_mode" is not set for a given field, that field is just copied as is to the translated record.
(Doesn't apply to flexform fields.)
Display / Proc.
list of keywords
This option can be used to define the language related field rendering. This has nothing to do with the processing of language overlays and data storage but the display of form fields.
- hideDiff – The differences to the default language field will not be displayed.
- defaultAsReadonly – This renders the field as read only field with the content of the default language record. The field will be rendered even if 'l10n_mode' is set to 'exclude'. While 'exclude' define the field not to be translated this option activate display of the default data.
When localization mode is set for a TCEforms, it must be either of these values. Only the fields that have l10n_cat set to the localization mode is shown. Used to limit display so only most relevant fields are shown to translators. It doesn't prevent editing of other fields if records are edited outside localization mode, it merely works as a display condition.
It is also used in localization export (pending at this moment).
Contains the actual configuration properties of the fields display and processing behavior.
The possibilities for this array depend on the value of the array key "type" within the array. Each valid value for "type" is shown below in a separate table.
Furthermore there are some properties common to all field types, described in the next chapter "['columns'][field name]['config'] / Common properties".
Contains one or more condition rules for whether to display the field or not.
Conditions can be grouped and nested using boolean operators
OR as array keys. See examples below.
A rule is a string divided into several parts by ":" (colons).
The first part is the rule-type and the subsequent parts will depend on the rule type.
The following rules are available:
- FIELD : This evaluates based on another field's value in the
- Part 1 is the field name
- Part 2 is the evaluation type. These are the possible options:
- REQ : Requires the field to have a "true" value. False values are "" (blank string) and 0 (zero) or if the field does not exist at all. All else is true. For the REQ evaluation type Part3 of the rules string must be the string "true" or "false". If "true" then the rules returns "true" if the evaluation is true. If "false" then the rules returns "true" if the evaluation is false.
- > / < / >= / <= : Evaluates if the field value is greater than, less than the value in "Part 3"
- = / != : Evaluates if the field value is equal to value in "Part 3"
- IN / !IN : Evaluates if the field value is in the comma list equal to value in "Part 3"
- - / !- : Evaluates if the field value is in the range specified by value in "Part 3" ([min] - [max])
- BIT / !BIT : Evaluates if the bit specified by the value in "Part 3" is set in the field's value (considered as an integer)
- REC : This evaluates based on the current record (doesn't make
sense for flexform fields)
- Part 1 is the type.
- NEW : Requires the record to be new if Part2 is "true" and reversed if Part2 is "false".
- Part 1 is the type.
- HIDE_FOR_NON_ADMINS: This will hide the field for all non-admin users while admins can see it. Useful for FlexForm container fields which are not supposed to be edited directly via the FlexForm but rather through some other interface (TemplaVoilà's Page module for instance).
- USER: userFunc call with a fully qualified classname.
Additional parameters can be be passed separated by colon.
- Part 1 is the type:
- IS : Part 2 is "true" or "false": If true, the field is shown only if the record is a version (pid == -1)
- Part 1 is the type:
For FlexForm elements the fields are tags on same level.
The field-values of the FlexForm-parent record are prefixed with "parentRec.". These fields can be used like every other field.
In FlexForm, display conditions can be attached to single fields in sheets,
to sheets itself, to flex section fields and to flex section container element
FIELD references can be prefixed with a sheet name to
reference a field from a neighbor sheet.
This example will require the field named "tx_templavoila_ds" to be true, otherwise the field for which this rule is set will not be displayed:
'displayCond' => 'FIELD:tx_templavoila_ds:REQ:true',
This example requires the extension "static_info_tables" to be loaded, otherwise the field is not displayed (this is useful if the field makes a look-up on a table coming from another extension!):
'displayCond' => 'EXT:static_info_tables:LOADED:true',
The two above conditions could be combined to be both required:
'displayCond' => array( 'AND' => array( 'FIELD:tx_templavoila_ds:REQ:true', 'FIELD:header:=:Headline', ) )
Going further the next example defines the following conditions: for the "spaceAfter" field to be displayed, the content element must be in the default or "All" language. Furtheremore it must either be a text-type element or have some "spaceBefore" defined:
'displayCond' => array( 'AND' => array( 'FIELD:sys_language_uid:<=:0', 'OR' => array( 'FIELD:CType:=:text', 'FIELD:spaceBefore:>:0' ) ) );
The last example requires the header-field of the FlexForm-parent record to be true, otherwise the FlexForm field is not displayed (works only within FlexForm datastructure definitions):