#107816Allow to adjust CType groups via API
Description
The new method called “ ExtensionManagementUtility::addRecordType() “ allows to configure content elements. It is used by the TYPO3 core in EXT:frontend for the default content elements.
It would be useful to adjust/override the group of an existing content element.
*Use case:*
Imagine an installation where CTypes “Table” and “File links” are disabled.
“bullets” will be the only content element left in group “Lists” and therefore should be moved to another group, e.g. “Typical page content”.
This would allow to reduce the number of listed groups in the “New content element wizard”. Which becomes especially useful when custom content elements and third-party plugins (like EXT:news) add further items to the list.
We could use Page TSconfig to adjust the “New content element wizard”:
mod.wizards.newContentElement.wizardItems {
lists.removeItems := addToList(bullets)
default.elements.bullets {
iconIdentifier = mimetypes-x-content-list-bullets
title = LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.bullets
description = LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.bullets.description
}
}
But while “ addRecordType() “ applies to both the wizard and the “Type” select field in content elements, the configuration above only affects the wizard.
It would be beneficial for editors if wizard and select list are properly aligned.
As a side note, the TSconfig approach is not compatible with EXT:content_defender (v3.5.3). Manually adding “bullets” to the default group would list this CType in the wizard even if it is disallowed (if selected, CType would then fall back to an allowed type in the initial editing view).
Using TCA Overrides is currently not an option, as the CType items are added via numeric keys to the array, which could change:
$GLOBALS[‘TCA’][‘tt_content’][‘columns’][‘CType’][‘config’][‘items’][‘6’][‘group’] = ‘default’; // CType may be or not be “bullets”Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 4
-
Garvin Hicking commented and changed status
NewNeeds Feedback 10/24/25, 14:48 -
Sebastian Klein commented 10/28/25, 07:21
Hi Garvin,
thank you for this solution. It works fine for me as-is and allows to arrange the given content elements as needed in each project.
Feel free to close this issue.
-
Garvin Hicking commented and changed status
Needs FeedbackClosed 11/01/25, 23:57Thanks for the feedback! Closing off in this case :-)
-
Sybille Peters commented 05/28/26, 07:52
I ran into same problem. The solution from Garvin worked for me:
$GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] = array_map(static function ($item) { if ($item['value'] === 'bullets') { $item['group'] = 'default'; } return $item; }, $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items']);With the change in TYPO3 it reduces configuration if you just use the automatic configuration from TCA and do not want to change it.
But it also has these drawbacks (for new content element wizard):
- not possible to see complete configuration via “Active page TSconfig” or via TCA AFAIK (because some may be overridden via TSconfig and TCA shows only TCA configuration and “active page TSconfig” shows only TSconfig configuration, which used to be complete but now is not)
- more complicated to change group or order than before
- changing stuff via TSConfig not as easily possible as before, element configuration has to be redefined completely.It used to be possible to do something like this:
mod.wizards.newContentElement.wizardItems.default.elements.uploads < mod.wizards.newContentElement.wizardItems.list.elements.uploads
But now, the via TCA configured elements are not reflected in TSconfig mod.wizards.newContentElement. So you have to redefine it completely in TSconfig if you want to override it in TSconfig.
Currently using v13, my thoughts are based on v13.
Hi Sebastian,
I talked this over with Oliver Bartsch yesterday. We think this is harder to achieve with a good public API, as the needs to move items around might be very specific, and bearing in mind other extensions of a setup is hard. So a solution on project-level (like a sitepackage extension) would probably be best.
You should be able to use TCA overrides there with some more “checking” logic, like this (untested):
$GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] = array_map(static function ($item) { if ($item['value'] === 'bullets') { $item['group'] = 'default'; } return $item; }, $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items']);This would iterate the lists to remap items no matter their numerical index. Would this help you?