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

bernd wilke t3ng at bernd-wilke.net
Tue Jun 9 14:04:00 CEST 2015


Am 08.06.15 um 15:53 schrieb Falk Gebauer:
> 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;
> });

Do you really need to temporarily copy the global array?
I think TYPO3 misses a good API for BE moduls.

> \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',
>      )
> );

this works for me. fine.

>
> // 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',
>      )
> );

as my module is not extbased this does not work for me: I have no 
controller and no action. this results in invalid controller calls.
and while my module meanwhile worked, now I only get empty divs again.


bernd
-- 
http://www.pi-phi.de/cheatsheet.html



More information about the TYPO3-dev mailing list