Automatically added system fields to content types (tt_content)

Changed in version 13.3

The following tabs / palettes are added automatically to the showitem property of table tt_content:

  • The General tab with the general palette at the very beginning
  • The Language tab with the language palette after custom fields
  • The Access tab with the hidden and access palettes
  • The Notes tab with the rowDescription field
The edit form of a slider with its tabs. The above mentioned ones are underlined.

The underlined tabs are added automatically.

See Extended content element with custom fields for an example.

In case one of those palettes has been changed to no longer include the corresponding system fields, those fields are added individually depending on their definition in the Table properties (ctrl) section.

By default, all custom fields - the ones still defined in showitem - are added after the general palette and are therefore added to the General tab, unless a custom tab (for example Plugin, or Categories) is defined in between. It's also possible to start with a custom tab by defining a --div-- as the first item in the showitem. In this case, the General tab will be omitted.

All those system fields, which are added based on the ctrl section are also automatically removed from any custom palette and from the customized type's showitem definition.

If the content element defines the Extended tab, it will be inserted at the end, including all fields added to the type via API methods, without specifying a position, via \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTcaTypes(). See Extended content element with custom fields for an example.

Examples for the showitems TCA section in content elements

Basic custom content element with header and bodytext

EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

// Add the content element to the "Type" dropdown
ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    [
        'label' => 'My extension basic text element',
        'value' => 'my_extension_basic_text',
    ],
);

// Add the predefined fields to the "General" tab
$GLOBALS['TCA']['tt_content']['types']['my_extension_basic_text']['showitem'] =
    '--palette--;;headers,bodytext,';
Copied!

The following tabs are shown, the header palette and bodytext field are shown in palette general:

Screenshot of the content element form created by the code

Screenshot of the content element form created by the code

Extended content element with custom fields

EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

// Add the content element to the "Type" dropdown
ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    [
        'label' => 'My extension custom text element with links',
        'value' => 'my_extension_extended-text',
        'icon' => 'my-extension-content-text',
        'group' => 'default',
        'description' => 'Some descripton',
    ],
    'textmedia',
    'after',
);

// Define some custom columns
$additionalColumns = [
    'my_extension_link' => [
        'label' => 'My link',
        'config' => [
            'type' => 'link',
        ],
    ],
    'my_extension_link_text' => [
        'label' => 'My link text',
        'config' => [
            'type' => 'input',
        ],
    ],
    'my_extension_extra_text' => [
        'label' => 'My extra text',
        'config' => [
            'type' => 'input',
        ],
    ],
];
// Add the custom columns to the TCA of tt_content
ExtensionManagementUtility::addTCAcolumns('tt_content', $additionalColumns);

// Add predefined and custom fields to the "General tab" and introduce a tab called "Extended"
$GLOBALS['TCA']['tt_content']['types']['my_extension_extended-text']['showitem'] = '
    --palette--;;headers,
    bodytext,
    --div--;My tab,
        my_extension_link,
        my_extension_link_text,
    --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,';

// This field will be added in tab "Extended"
ExtensionManagementUtility::addToAllTCAtypes(
    'tt_content',
    'my_extension_extra_text',
    'my_extension_extended-text'
);
Copied!

The following tabs are shown:

Screenshot of the content element form created by the code

Screenshot of the content element form created by the code

Additional fields that are subsequently added to the end of the table using \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTcaTypes() will appear in the tab Extended.

Migration: Remove system fields from showitems on dropping TYPO3 v12.4 support

It is sufficient to apply changes to the showitem section of content types once dropping TYPO3 v12.4 support in extensions.

In site packages or extensions only supporting TYPO3 v13.3 or above you can migrate the showitem right away:

EXT:my_extension/Configuration/TCA/Overrides/tt_content.php (diff)
 'slider' => [
     'showitem' => '
-        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
-            --palette--;;general,
             --palette--;;headers,
             slider_elements,
             bodytext;LLL:EXT:awesome_slider/Resources/Private/Language/locallang_ttc.xlf:bodytext.ALT.slider_description,
         --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:appearance,
             --palette--;;frames,
             --palette--;;appearanceLinks,
-        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
-            --palette--;;language,
-        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
-            --palette--;;hidden,
-            --palette--;;access,
         --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
             categories,
-        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
-            rowDescription,
         --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
     ',
 ],
Copied!

So the tabs General, Language, Access and Notes are now added automatically together with the corresponding system fields.