benjaminkott / bootstrap_package

Bootstrap Package delivers a full configured theme for TYPO3, based on the Bootstrap CSS Framework.
https://www.bootstrap-package.com/
MIT License
338 stars 207 forks source link

FEATURE: using v10 feature #91008 "Item grouping for TCA select items" #925

Open Moongazer opened 4 years ago

Moongazer commented 4 years ago

Editing a content element, the select-list for CType is quite messy, because unlike for the newContentElementWizard the content-elements are not grouped here yet.

To implement the new feature #91008 is quite easy:

Edit Configuration/TCA/Overrides/102_tt_content.php to use new API:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItemGroup(
    'tt_content',
    'CType',
    'bootstrap_package',
    'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:theme_name',
    'after:default'
); 

Edit all content-element TCA definitions to add the group key, e.g. for 200_content_element_accordion.php:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    [
        'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.accordion',
        'accordion',
        'content-bootstrappackage-accordion',
        'bootstrap_package' // add the group item name here as 4th parameter
    ],
    '--div--',
    'after'
);
gilbertsoft commented 4 years ago

Thanks for that proposition which seems to be a good idea for the next major release.