Examples 

Some examples from the conference extension to get an idea of what the field definition is capable of: a select drop-down with images, an inline relation used by two tables, and the options for translated records.

Select drop-down for records represented by images 

The images of the locations below the location field of a conference

The images of the locations below the location field of a conference

The location of a conference is a select field with a relation to the location table and the field wizard selectIcons:

EXT:my_extension/Configuration/TCA/Overrides/110-tx_myextension_conference-location.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'location' => [
    'label' => 'my_extension.db:conference.location',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'foreign_table' => 'tx_myextension_location',
      'items' => [
        ['label' => '', 'value' => 0],
      ],
      'fieldWizard' => [
        'selectIcons' => [
          'disabled' => false,
        ],
      ],
      'relationship' => 'manyToOne',
      // Venues only, not their halls
      'foreign_table_where' => 'AND {#tx_myextension_location}.{#parent} = 0 ORDER BY tx_myextension_location.name',
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'location',
  '',
  'after:conference_date',
);
Copied!

The location table names its field with the image as selicon_field:

EXT:my_extension/Configuration/TCA/tx_myextension_location.php
<?php

return [
  'ctrl' => [
    'title' => 'my_extension.db:location',
    'label' => 'name',
    'label_alt' => 'city',
    'label_alt_force' => true,
    'selicon_field' => 'image',
    'default_sortby' => 'name',
    'rootLevel' => -1,
    'security' => [
      'ignoreRootLevelRestriction' => true,
    ],
    'tstamp' => 'tstamp',
    'crdate' => 'crdate',
    'delete' => 'deleted',
    'iconfile' => 'EXT:my_extension/Resources/Public/Icons/Location.svg',
  ],
  'columns' => [
    'name' => [
      'label' => 'my_extension.db:location.name',
      'config' => [
        'type' => 'input',
        'required' => true,
      ],
    ],
    'city' => [
      'label' => 'my_extension.db:location.city',
      'config' => [
        'type' => 'input',
      ],
    ],
    'image' => [
      'label' => 'my_extension.db:location.image',
      'config' => [
        'type' => 'file',
        'maxitems' => 1,
        'allowed' => 'common-image-types',
        'relationship' => 'manyToOne',
      ],
    ],
  ],
  'types' => [
    '0' => [
      'showitem' => 'name, city, image',
    ],
  ],
];
Copied!

Inline relation (IRRE) spanning multiple tables 

The comments of a talk

The comments of a talk

Visitors comment on conferences and on talks. Both tables use the same comment table: the comment stores the uid of its parent record in parent, and the table of the parent in parent_table:

EXT:my_extension/Configuration/TCA/Overrides/255-tx_myextension_talk-comments.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
  'comments' => [
    'label' => 'my_extension.db:talk.comments',
    'config' => [
      'type' => 'inline',
      'foreign_table' => 'tx_myextension_comment',
      'foreign_field' => 'parent',
      'foreign_table_field' => 'parent_table',
      'appearance' => [
        'enabledControls' => [
          'new' => false,
        ],
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_talk',
  'comments',
  '',
  'before:--div--;core.form.tabs:access',
);
Copied!

Example: prefixLangTitle 

On translating a record in a new language the content of the field gets copied to the target language. It gets prefixed with [Translate to <language name>:], here in the description of a conference:

The description of a translated conference

The description of a translated conference

The language mode is defined as follows:

EXT:my_extension/Configuration/TCA/Overrides/130-tx_myextension_conference-description.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'description' => [
    'label' => 'my_extension.db:conference.description',
    'l10n_mode' => 'prefixLangTitle',
    'config' => [
      'type' => 'text',
      'enableRichtext' => true,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'description',
  '',
  'before:--div--;core.form.tabs:categories',
);
Copied!

Disable the prefixLangTitle for the header field in tt_content 

Use the default behaviour instead of prefixLangTitle: the field will be copied without a prepended string.

EXT:my_sitepackage/Configuration/TCA/Overrides/tt_content.php
$GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = '';
Copied!

Select field with defaultAsReadonly 

The format of a conference is the same in all languages. The field has the option 'l10n_display' => 'defaultAsReadonly' set, so a translation shows the value of the default language, which cannot be changed:

The format of a translated conference

The format of a translated conference

EXT:my_extension/Configuration/TCA/Overrides/111-tx_myextension_conference-event_format.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'event_format' => [
    'label' => 'my_extension.db:conference.event_format',
    'onChange' => 'reload',
    'l10n_mode' => 'exclude',
    'l10n_display' => 'defaultAsReadonly',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        [
          'label' => 'my_extension.db:conference.event_format.onsite',
          'value' => 'onsite',
        ],
        [
          'label' => 'my_extension.db:conference.event_format.online',
          'value' => 'online',
        ],
        [
          'label' => 'my_extension.db:conference.event_format.hybrid',
          'value' => 'hybrid',
        ],
      ],
      'default' => 'onsite',
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'event_format',
  '',
  'after:conference_date',
);
Copied!

Translated field without l10n_display definition 

The salutation of a speaker has no l10n_display definition, so it can be changed in a translation:

The salutation of a translated speaker

The salutation of a translated speaker

EXT:my_extension/Configuration/TCA/Overrides/305-tx_myextension_speaker-salutation.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_speaker', [
  'salutation' => [
    'label' => 'my_extension.db:speaker.salutation',
    'config' => [
      'type' => 'select',
      'renderType' => 'selectSingle',
      'items' => [
        ['label' => '', 'value' => ''],
        [
          'label' => 'my_extension.db:speaker.salutation.mr',
          'value' => 'mr',
        ],
        [
          'label' => 'my_extension.db:speaker.salutation.ms',
          'value' => 'ms',
        ],
        [
          'label' => 'my_extension.db:speaker.salutation.mx',
          'value' => 'mx',
        ],
      ],
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_speaker',
  'salutation',
  '',
  'before:name',
);
Copied!