Create TYPO3 Backend module group with TYPO3 10.x

Viewed 232

I am trying to create backend module group with TYPO3 10.x. Module working well under existing module group such as "Web" module.

I am trying to add my own Module group, here is my code:

ext_tables.php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
    'CEBuilder',
    'cebuilder',
    'top',
    [
        \Dev\CEBuilder\Controller\ContentElemetController::class => 'list',
    ],
    [
        'name' => 'CEBuilder',
        'icon' => 'EXT:cebuilder/Resources/Public/Icons/Extension.svg',
        'labels' => [
            'll_ref' => 'LLL:EXT:cebuilder/Resources/Private/Language/locallang_mod.xlf'
        ]
    ]
);

It showing me module perfectly, but It's not showing main module label. enter image description here

I have find some solution and added below code,

if (!isset($GLOBALS['TBE_MODULES']['cebuilder'])) {
    $temp_TBE_MODULES = [];
    foreach ($GLOBALS['TBE_MODULES'] as $key => $val) {
        if ($key == 'web') {
            $temp_TBE_MODULES[$key] = $val;
            $temp_TBE_MODULES['cebuilder'] = '';
        } else {
            $temp_TBE_MODULES[$key] = $val;
        }
    }
    $GLOBALS['TBE_MODULES'] = $temp_TBE_MODULES;
    $GLOBALS['TBE_MODULES']['_configuration']['cebuilder'] = [
        'labels' => 'LLL:EXT:cebuilder/Resources/Private/Language/locallang_mod.xlf',
        'name' => 'cebuilder',
        'iconIdentifier' => 'module-cebuilder'
    ];
}

It was working in the previous version, earlier in TYPO3 version 7 or 8. But, somehow it's not working with TYPO3 10.x

Here is my locallang file

locallang_mod.xlf

<trans-unit id="mlang_tabs_tab" xml:space="preserve">
    <source>Company Tools</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
    <source>Description used for about screen, what does the extension do?</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel" xml:space="preserve">
    <source>Company Tools</source>
</trans-unit>
0 Answers
Related