cols

cols
Path

$GLOBALS['TCA'][$table]['columns'][$field]['config']

type

integer/string

Scope

Display

In how many columns the checkboxes will be shown. Makes sense only if the 'items' property is defining multiple checkboxes.

Allowed values are 1, 2, 3, ..., 31 or inline, 1 being default. If set to inline the checkboxes are "floating" and there will be as many in one row as fits to browser width.

Note checkboxes will still wrap if browser width is not sufficient.

Examples

Fixes columns

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'checkbox_2' => [
            'exclude' => 1,
            'label' => 'checkbox_2',
            'description' => 'one checkbox with label',
            'config' => [
                'type' => 'check',
                'items' => [
                    [
                        'foo',
                    ],
                ],
            ],
        ],
    ],
]
Copied!

Inline columns

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'checkbox_16' => [
            'exclude' => 1,
            'label' => 'checkbox_16',
            'description' => 'cols=inline',
            'config' => [
                'type' => 'check',
                'items' => [
                    [
                        'Mo',
                    ],
                    [
                        'Tu',
                    ],
                    [
                        'We',
                    ],
                    [
                        'Th',
                    ],
                    [
                        'Fr',
                    ],
                    [
                        'Sa',
                    ],
                    [
                        'Su',
                    ],
                ],
                'cols' => 'inline',
            ],
        ],
    ],
]
Copied!