Core API
4.2.16. ['types'][key] section
You have to add at least one entry in the "types"-configuration before any of the configured fields from the ['columns'] section will show up in TCEforms.
Required configuration
For instance, if you would like a form to look like below...:

... you could configure it with :
140: 'types' => Array (
141: '0' => Array('showitem' => 'hidden;;1, type, title, test_template'),
The key "showitem" lists the order in which to define the fields: "hidden, type, title, test_template"
Optional possibilities
The power of "types"-configuration is clear in the moment when you want the form composition of a record to depend on a value from the record. From the example above, lets say we want the selector box "type" to define the composition of fields in the form. This is configured like this:
2: 'ctrl' => Array (
3: 'title' => 'LLL:EXT:coreunittest/locallang_db.php:tx_coreunittest_1',
4: 'label' => 'title',
5: 'type' => 'type',
6: 'crdate' => 'crdate',
...
87: 'type' => Array (
88: 'exclude' => 0,
89: 'label' => 'LLL:EXT:coreunittest/locallang_db.php:tx_coreunittest_1.type',
90: 'config' => Array (
91: 'type' => 'select',
92: 'items' => Array (
93: Array('LLL:EXT:coreunittest/locallang_db.php:tx_coreunittest_1.type.I.0', '0'),
94: Array('LLL:EXT:coreunittest/locallang_db.php:tx_coreunittest_1.type.I.1', '1'),
95: Array('LLL:EXT:coreunittest/locallang_db.php:tx_coreunittest_1.type.I.2', '2'),
96: Array('LLL:EXT:coreunittest/locallang_db.php:tx_coreunittest_1.type.I.3', '3'),
97: ),
98: 'size' => 1,
99: 'maxitems' => 1,
100: )
101: ),
Line 5 defines that the field name "type" is to be used as pointer to a key in the types-configuration.
Line 87-101 shows the configuration of this selector box which turns out to be rather normal, having four static values.
In the end of the TCA configuration the "types" section contain four listings, one for each value of the selector box:
140: 'types' => Array (
141: '0' => Array('showitem' => 'hidden;;1, type, title, test_template'),
142: '1' => Array('showitem' => 'title, test_template, hidden, type'),
143: '2' => Array('showitem' => 'type, title'),
144: '3' => Array('showitem' => 'type;;2'),
145: ),
If the "type" selector box has the value "0" (zero, "Mode 1") you will see the same as in the example above. If it is changed to "1" (label "Mode 2"), then the form changes as well:

The order of fields in this case is clearly the one defined in line 142.
Changing the "type" value to "Mode 3" means we will see this form:

And "Mode 4":
![]()
Default values
If no "type" field is defined the type value will default to "0" (zero). If the type value (coming from a field or being zero by default) does not point to a defined index in the "types"-configuration, the configuration for key "1" will be used by default.
Notice: You must not show the same field more than once in the editing form. If you do, the field will not detect the value properly.
|
Key |
Datatype |
Description |
|---|---|---|
|
showitem |
string (list of field configuration sets) |
Required. Configuration of the displayed order of fields in TCEforms. The whole strings is divided by tokens according to a - unfortunately - complex ruleset.
Notice: Instead of a real fieldname you can theoretically insert "--div--" and you will have a divider line shown. However this is not rendered by default so it has no significance.
Another special fieldname, '--palette--', will insert a link to a palette (of course you need to specify a palette and title then...) |
|
subtype_value_field |
string (fieldname) |
Fieldname, which holds a value being a key in the 'subtypes_excludelist' array. This is used to specify a secondary level of 'types' - basically hiding certain fields of those found in the types-configuration, based on the value of another field in the row.
Example (from sysext/cms/tbl_tt_content.php):
'subtype_value_field' => 'list_type', 'subtypes_excludelist' => Array( '3' => 'layout', '1' => 'layout', '8' => 'layout', 'indexed_search' => 'layout,bodytext', ) |
|
subtypes_excludelist |
array |
See "subtype_value_field".
Syntax: "[field value]" => "[commalist of fields (from the main types-config) which are excluded]" |
|
subtypes_addlist |
array |
A list of fields to add when the "subtype_value_field" matches a key in this array.
See "subtype_value_field".
Syntax: "[value]" => "[commalist of fields which are added]
Notice: that any transformation configuration used by TCE will NOT work because that configuration is visible for the TCEforms class only during the drawing of fields. In other words any configuration in this list of fields will work for display only." |
|
bitmask_value_field |
string (fieldname) |
Fieldname, which holds a value being the integer (bit-mask) for the 'bitmask_excludelist_bits' array. It works much like 'subtype_value_field' but excludes fields based on whether a bit from the value field is set or not. See 'bitmask_excludelist_bits'; [+/-] indicates whether the bit [bit-number] is set or not.
Example:
'bitmask_value_field' => 'active', 'bitmask_excludelist_bits' => Array ( '-0' => 'tmpl_a_subpart_marker,tmpl_a_description', '-1' => 'tmpl_b_subpart_marker,tmpl_b_description', '-2' => 'tmpl_c_subpart_marker,tmpl_c_description' ) |
|
bitmask_excludelist_bits |
array |
See "bitmask_value_field"
"[+/-][bit-number]" => "[commalist of fields (from the main types-config) excluded]" |
Now follows a codelisting as example:
Example - simple configuration:
This is a quite normal and simple configuration. In the "types" section the list of fields does not contain much additional stuff except the first entry which configures "Part 5" - the colorscheme for the whole form.
Basically the "showitem" list is just listing the fieldnames which will be displayed.
'types' => Array (
'0' => Array('showitem' => 'name;;;;1-1-1, age, language, allergies, allergies_list, institution, babysitting, other')
),
The result of this configuration looks like this:

Example - semi complex configuration:
This is a semi-complex example taken from the "mininews" extension. It does include configuration of the rich text editor which is the main reason for the lengthyness. Notice the "palettes" definition which the example includes. The palette has number "1" and will be triggered when the user puts the focus on the field "hidden" (according to the configuration in the "types" list).
'types' => Array (
'0' => Array('showitem' => 'hidden;;1;;1-1-1, datetime, title;;;;2-2-2, teaser;;;;3-3-3, full_text;;;richtext[cut|copy|paste|formatblock|textcolor|bold|italic|underline|left|center|right|orderedlist|unorderedlist|outdent|indent|link|table|image|line|chMode]:rte_transform[mode=ts_css|imgpath=uploads/tx_mininews/rte/], front_page')
),
'palettes' => Array (
'1' => Array('showitem' => 'starttime, endtime, fe_group')
)
Example - complex configuration:
This is a part of the "types" definition for the "tt_content" table. This is one of the more advanced configurations, including basically all the levels of options you can use:
'types' => Array (
'1' => Array('showitem' => 'CType'),
'header' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, subheader;;8'),
'text' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, bodytext;;9;richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|outdent|indent|link|image]:rte_transform[flag=rte_enabled|mode=ts];3-3-3, rte_enabled, text_properties'),
'textpic' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, bodytext;;9;richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|outdent|indent|link|image]:rte_transform[flag=rte_enabled|mode=ts];3-3-3, rte_enabled, text_properties, --div--, image;;;;4-4-4, imageorient;;2, imagewidth;;13,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgLinks;7,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgOptions;11,
imagecaption;;5'),
'rte' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, bodytext;;;nowrap:richtext[*]:rte_transform[mode=ts_images-ts_reglinks];3-3-3'),
'image' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, image;;;;4-4-4, imageorient;;2, imagewidth;;13,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgLinks;7,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgOptions;11,
imagecaption;;5'),
'bullets' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, layout;;;;3-3-3, bodytext;;9;nowrap, text_properties'),
'table' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, layout;;10;button;3-3-3, cols, bodytext;;9;nowrap:wizards[table], text_properties'),
'splash' => Array('showitem' => 'CType;;4;button;1-1-1, header;LLL:EXT:lang/locallang_general.php:LGL.name;;;2-2-2, splash_layout, bodytext;;;;3-3-3, image;;6'),
'uploads' => Array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, media;;;;5-5-5,
select_key;LLL:EXT:cms/locallang_ttc.php:select_key.ALT.uploads,
layout;;10;button, filelink_size,
imagecaption;LLL:EXT:cms/locallang_ttc.php:imagecaption.ALT.uploads;;nowrap'),