Examples 

Example: Default checkboxes with fixed columns 

A single checkbox with a label

A single checkbox with a label

EXT:my_extension/Configuration/TCA/Overrides/241-tx_myextension_talk-recording_allowed.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
  'recording_allowed' => [
    'label' => 'my_extension.db:talk.recording_allowed',
    'config' => [
      'type' => 'check',
      'items' => [
        ['label' => 'my_extension.db:talk.recording_allowed.item'],
      ],
      'behaviour' => [
        'allowLanguageSynchronization' => true,
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_talk',
  'recording_allowed',
  'talk,keynote',
  'after:recording',
);
Copied!

Example: Checkboxes with Inline columns and default value 

The weekdays of a location, Monday to Friday checked by default

The weekdays of a location, Monday to Friday checked by default

Monday to Friday, the first five bits, are active by default.

EXT:my_extension/Configuration/TCA/Overrides/430-tx_myextension_location-open_days.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_location', [
  'open_days' => [
    'label' => 'my_extension.db:location.open_days',
    'config' => [
      'type' => 'check',
      'items' => [
        ['label' => 'my_extension.db:location.open_days.monday'],
        ['label' => 'my_extension.db:location.open_days.tuesday'],
        ['label' => 'my_extension.db:location.open_days.wednesday'],
        ['label' => 'my_extension.db:location.open_days.thursday'],
        ['label' => 'my_extension.db:location.open_days.friday'],
        ['label' => 'my_extension.db:location.open_days.saturday'],
        ['label' => 'my_extension.db:location.open_days.sunday'],
      ],
      'cols' => 'inline',
      // Monday to Friday: the first five bits
      'default' => 31,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_location',
  'open_days',
  '',
  'after:capacity',
);
Copied!

Example: Checkbox limited to a maximal number of checked records 

Only one location can be the main venue

Only one location can be the main venue

EXT:my_extension/Configuration/TCA/Overrides/435-tx_myextension_location-main_venue.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_location', [
  'main_venue' => [
    'label' => 'my_extension.db:location.main_venue',
    'config' => [
      'type' => 'check',
      'items' => [
        ['label' => 'my_extension.db:location.main_venue.item'],
      ],
      'eval' => 'maximumRecordsChecked',
      'validation' => [
        'maximumRecordsChecked' => 1,
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_location',
  'main_venue',
  '',
  'after:name',
);
Copied!

Example: Toggle checkbox with invertStateDisplay 

The field hidden that TYPO3 adds for ctrl > enablecolumns > disabled
'hidden' => [
  'label' => 'core.db.general:enabled',
  'exclude' => true,
  'config' => [
    'type' => 'check',
    'renderType' => 'checkboxToggle',
    'default' => 0,
    'items' => [
      [
        'label' => '',
        'invertStateDisplay' => true,
      ],
    ],
  ],
],
Copied!

Example: Checkboxes with icons 

Three tasks of a talk, two with a tick and one with a clock

Two tasks are finished, one is still open

Each checkbox of the preparation of a talk shows a tick in a circle when it is checked, and a clock when it is not:

EXT:my_extension/Configuration/TCA/Overrides/295-tx_myextension_talk-checklist.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
  'checklist' => [
    'label' => 'my_extension.db:talk.checklist',
    'config' => [
      'type' => 'check',
      // A finished task shows a tick in a circle, an open task a clock
      'items' => [
        [
          'label' => 'my_extension.db:talk.checklist.slides',
          'iconIdentifierChecked' => 'actions-check-circle',
          'iconIdentifierUnchecked' => 'actions-clock',
        ],
        [
          'label' => 'my_extension.db:talk.checklist.recording',
          'iconIdentifierChecked' => 'actions-check-circle',
          'iconIdentifierUnchecked' => 'actions-clock',
        ],
        [
          'label' => 'my_extension.db:talk.checklist.technical_check',
          'iconIdentifierChecked' => 'actions-check-circle',
          'iconIdentifierUnchecked' => 'actions-clock',
        ],
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_talk',
  'checklist',
  '',
  'before:--div--;core.form.tabs:access',
);
Copied!

Example: Checkboxes with itemsProcFunc 

An itemsProcFunc adds items to the checkboxes. See the example of itemsProcFunc, which adds the tracks of a conference to a select field.

The conference extension adds the days of a talk with the newer itemsProcessors instead, which read the dates of the conference.

Example: checkboxToggle 

A toggle

A toggle

Example: checkboxLabeledToggle 

A toggle with the labels Open and Closed

A toggle with the labels Open and Closed

Example: Only one record on a page can be checked 

Each conference keeps its hotels in a folder of its own. Only one hotel in a folder can be the recommended hotel:

EXT:my_extension/Configuration/TCA/Overrides/955-tx_myextension_hotel-recommended.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_hotel', [
  'recommended' => [
    'label' => 'my_extension.db:hotel.recommended',
    'config' => [
      'type' => 'check',
      'items' => [
        ['label' => 'my_extension.db:hotel.recommended.item'],
      ],
      // Each conference keeps its hotels in a folder of its own and
      // recommends one of them
      'eval' => 'maximumRecordsCheckedInPid',
      'validation' => [
        'maximumRecordsCheckedInPid' => 1,
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_hotel',
  'recommended',
  '',
  'after:name',
);
Copied!