Issue Feature New Orphaned

#106802Allow custom group labels and icons for groupName in TCA ctrl configuration

Thomas Rawiel 06/01/25, 16:30 updated 06/01/25, 16:30

Description

I would like to define custom icons and labels for each groupName used in the TCA ctrl configuration,
so that I can organize multiple distinct groups of records within a single extension in the “New Record” wizard, each with its own meaningful visual identity.

Current Behavior

Currently, TYPO3 allows grouping records in the “New Record” wizard using the TCA configuration:

$GLOBALS['TCA']['my_table']['ctrl']['groupName'] = 'my_extension_key';
However:
The label for the group is derived automatically in 1 of 2 ways:

The icon for the group is always taken from the extension icon (ext_icon.svg).
There is no way to override the group label or icon per groupName.

https://github.com/TYPO3/typo3/blob/60e08ed6d6efd6e23371639897cba1055cb16d46/typo3/sysext/backend/Classes/Controller/NewRecordController.php#L422

Although you technically can define multiple groups, all of the groups will have the same title and icon.
This logically limits developers to only one visual group per extension, even if they want to logically separate different types of records (e.g. content types vs. configurations) under the same extension.

Desired behaviour

Add support for:
  • Custom group label localization, e.g. via a dedicated label key (e.g. group.[groupName].title)
  • Custom group icons, e.g. via EXT:my_extension/Resources/Public/Icons/GroupMyGroup.svg or iconIdentifier tx-myext-mygroupicon

Configuration option (example):

$GLOBALS['TCA']['my_table']['ctrl'] = [
    'groupName' => 'custom_group_1',
    'groupLabel' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang_db.xlf:group.custom_group_1.title', 
    'groupIcon' => 'EXT:my_extension/Resources/Public/Icons/GroupCustomGroup1.svg', // or 'tx-myIconIdentifier'
];

But since we don’t want to redefine groupLabel and groupIcon for each individual table, we would need something like a group metadata.
We could use, for example

$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['my_extension']['groupMetadata'] = [
    'custom_group_1' => [
        'label' => 'LLL:EXT:your_extension/Resources/Private/Language/locallang_db.xlf:group.news',
        'icon' => 'EXT:your_extension/Resources/Public/Icons/group-news.svg',
    ],
    'custom_group_2' => [
        'label' => 'LLL:EXT:your_extension/Resources/Private/Language/locallang_db.xlf:group.events',
        'icon' => 'tx-myext-iconIdentifier',
    ],
];

Maybe add an API function that populates that config, e.g. ExtensionManagementUtility::addTcaCtrlGroup($extkey, $groupName, $label, $icon)

If no group metadata exists we can still use the mechanic we have today

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[FEATURE] Allow custom group labels and icons for groupName in TCA ctrl configuration Resolves: #106802 Releases: main