items

items
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display

If set, this array will create an array of checkboxes instead of just a single "on/off" checkbox.

In this array each entry is itself an associative array. The value sent to the database will be an integer representing a bit mask based on the position of the checkbox in this array.

A basic item looks like this:

'items' => [
    ['label' => 'Green tomatoes'], // Note these should be LLL references
    ['label' => 'Red peppers'],
],
Copied!

Deprecated since version 12.3

Using the numerical index 0 for setting the label is deprecated. Use the newly introduced label key.

Further properties can be set per item, but not all of them apply to all renderTypes:

label (string or LLL reference)
The displayed title.
invertStateDisplay (boolean)
All renderTypes. If set to true, checked / unchecked state are swapped in view: A checkbox is marked checked if the database bit is not set and vice versa.
iconIdentifierChecked (string)
Only if renderType is not set (default): An optional icon shown is selected / on. If not set, a check mark icon is used.
iconIdentifierUnchecked (string)
Only if renderType is not set (default): An optional icon shown selected / on. If not set, no icon is show (check mark icon not displayed).
labelChecked (string)
Mandatory property for renderType checkboxLabeledToggle: Text shown if element is selected / on.
labelUnchecked (string)
Mandatory property for renderType checkboxLabeledToggle: Text shown if element is not selected.

Examples

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'checkbox_3' => [
            'label' => 'checkbox_3',
            'description' => 'three checkboxes, two with labels, one without',
            'config' => [
                'type' => 'check',
                'items' => [
                    [
                        'label' => 'foo',
                    ],
                    [
                        'label' => '',
                    ],
                    [
                        'label' => 'foobar',
                        'iconIdentifierChecked' => 'content-beside-text-img-below-center',
                        'iconIdentifierUnchecked' => 'content-beside-text-img-below-center',
                    ],
                ],
            ],
        ],
    ],
]
Copied!