Toggle checkbox

The checkbox with the renderType checkboxToggle renders as one or several toggle switches. As opposed to the Labeled toggle checkbox no additional labels for the states can be defined.

Its state can be inverted via invertStateDisplay.

Examples

Example: Single checkbox with toggle

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'checkbox_17' => [
            'exclude' => 1,
            'label' => 'checkbox_17',
            'description' => 'renderType=checkboxToggle single',
            'config' => [
                'type' => 'check',
                'renderType' => 'checkboxToggle',
                'items' => [
                    [
                        0 => 'foo',
                        'labelChecked' => 'Enabled',
                        'labelUnchecked' => 'Disabled',
                    ],
                ],
            ],
        ],
    ],
]
Copied!

checkboxToggle: Instead of checkboxes, a toggle item is displayed.

Example: Single checkbox with toggle inverted state display

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'checkbox_18' => [
            'exclude' => 1,
            'label' => 'checkbox_18',
            'description' => 'renderType=checkboxToggle single inverted state display',
            'config' => [
                'type' => 'check',
                'renderType' => 'checkboxToggle',
                'items' => [
                    [
                        0 => 'foo',
                        'labelChecked' => 'Enabled',
                        'labelUnchecked' => 'Disabled',
                        'invertStateDisplay' => true,
                    ],
                ],
            ],
        ],
    ],
]
Copied!

invertedStateDisplay: A checkbox is marked checked if the database bit is not set and vice versa.