[TYPO3-dev] best practice for a new BE module with own section

Falk Gebauer fgebauer at 3pc.de
Mon Jun 8 15:53:41 CEST 2015


Hi Bernd,

I use the extbase extension utility and do something like this:


$mainModuleName = 'main_module_name';
if (!isset($TBE_MODULES[$mainModuleName])) {
     $temp_TBE_MODULES = array();
     foreach ($TBE_MODULES as $key => $val) {
         if ($key == 'web') {
             $temp_TBE_MODULES[$key] = $val;
             $temp_TBE_MODULES[$mainModuleName] = 'main_module_name';
         } else {
             $temp_TBE_MODULES[$key] = $val;
         }
     }
     $TBE_MODULES = $temp_TBE_MODULES;
});
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
     'Xxx.' . $_EXTKEY,
     'main_module_name',
     '',
     'after:web',
     array(
     ), array(
         'access' => 'user,group',
         'icon' => '',
         'labels' => 
'LLL:EXT:xxx/Resources/Private/Language/MainModule.xlf',
     )
);


// sub module
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
     'Xxx.' . $_EXTKEY,
     'main_module_name',
     'sub_module_name',
     'bottom',
     array(
         'Controller1' => 'list, upload, search',
     ), array(
         'access' => 'user,group',
         'icon' => 'EXT:xxx/ext_icon.gif',
         'labels' => 'LLL:EXT:xxx/Resources/Private/Language/SubModule.xlf',
     )
);

Greets
Falk


Am 08.06.15 um 13:15 schrieb bernd wilke:
> I want a new BE-submodule within it's own BE-module and have some 
> problems:
>
> 1. I get no title for the new module (only submodule title shows up)
>
> 2. the new module always appears at the end instead after the web module
>
> $moduleConfiguration = array(
>     'name' => 'newmodule_newsubmodule',
>     'script' => '_DISPATCH',
>     'access' => 'user,group',
>     );
>
> \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
>     'newmodule',
>     'newsubmodule',
>     'after:web',
>     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) 
> . 'submod/',
>     $moduleConfiguration
> );
>
>
>
>
> 3. the configuration, which should be in the fifth parameter of 
> addModule() is ignored and the frame is empty (no content, the HTML 
> consists of a full head and only some empty divs in body)
>
> I tried the definition above for $moduleConfiguration as I read this 
> parameter should replace conf.php. I found no further explanation 
> about the needed structure.
> leaving the data in conf.php the Module shows up
>
> - - -
>
> I hope my question will be answered here, but the same question on 
> slack stays unanswered and scrolled of the screen in a hurry.
>
> bernd

-- 
Falk Gebauer
fgebauer at 3pc.de

Amtsgericht Berlin Charlottenburg
HRB 794 28
USt-IdNr.: DE217652890

-----------------------------------------------
facebook.com/3pc.de
plus.3pc.de
twitter.com/3pc
flickr.com/photos/3pc




More information about the TYPO3-dev mailing list