Examples

Simple select checkbox with 3 possible values

../../../../_images/SelectCheckbox1.png

The select checkbox stores the values as comma separated values.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_checkbox_1' => [
            'label' => 'select_checkbox_1 description',
            'description' => 'field description',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectCheckBox',
                'items' => [
                    [
                        'foo 1',
                        1,
                    ],
                    [
                        'foo 2',
                        2,
                    ],
                    [
                        'foo 3',
                        3,
                    ],
                ],
            ],
        ],
    ],
]

Select checkbox with icons and groups

../../../../_images/SelectCheckbox7.png

The select checkbox stores the values as comma separated values.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_checkbox_7' => [
            'label' => 'select_checkbox_7',
            'description' => 'itemGroups',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectCheckBox',
                'items' => [
                    [
                        'foo 1',
                        1,
                        '',
                        'group1',
                    ],
                    [
                        'foo 2',
                        2,
                        'EXT:styleguide/Resources/Public/Icons/tx_styleguide.svg',
                        'group1',
                    ],
                    [
                        'foo 3',
                        3,
                        'EXT:styleguide/Resources/Public/Icons/tx_styleguide.svg',
                    ],
                    [
                        'foo 4',
                        4,
                    ],
                    [
                        'foo 5',
                        1,
                        '',
                        'group3',
                    ],
                ],
                'itemGroups' => [
                    'group1' => 'Group 1 with items',
                    'group2' => 'Group 2 with no items',
                    'group3' => 'Group 3 with items',
                ],
            ],
        ],
    ],
]