[TYPO3-dev] Creating a new Category (besides web, user, admin, ...) for a BE-Module

Christian Weiske christian.weiske at netresearch.de
Wed Jul 13 08:48:20 CEST 2011


Hello Thomas,


> But we need the module to appear in its own category; not under
> "Web", "Admin", "Tools" or whatsoever.
> I've taken a good look around (i suppose) and tried adapting the old 
> TYPO3-behavior to my Extbase extension, meaning i tried using the 
> ext_tables.php t3lib_extMgm::addModule-Function. But the problem - as
> i soon discovered - seems to be that this is just not adaptable (as
> the addModule()-function uses the module's path inside the extension
> as a parameter... but in Extbase there just is no such path).

This is the code I use to add a new main and a submodule:

    // Add main module
    t3lib_extMgm::addModule(
        //'web', 'txfooImport', '',
        'foo', '', '',
        t3lib_extMgm::extPath($_EXTKEY) . 'mod_main/'
    );
    // Add sub module
    t3lib_extMgm::addModule(
        'av', 'txfooImport', '',
        t3lib_extMgm::extPath($_EXTKEY) . 'mod_import/'
    );

The mod_main dir needs to contain a conf.php specifying the module
settings - nothing more:
> define('TYPO3_MOD_PATH', '../typo3conf/ext/foo/mod_main/');
> $BACK_PATH = '../../../../typo3/';
> $MCONF['name'] = 'foo';
> $MCONF['access'] = 'user,group';
> $MCONF['script'] = '_DISPATCH';
> $MCONF['defaultMod'] = 'txfooImport';
> $MLANG['default']['ll_ref'] =
> 'LLL:EXT:foo/res/locallang_mod_main.xml';

The mod_import dir also needs to contain a conf.php, and you can
directly tell which script is to be used:
> $MCONF['script'] = 'index.php';

You could add those directories to your extension (does not harm
anyone) or make the script your extbase's mod script.

-- 
Viele Grüße
Dipl.-Inf. Christian Weiske

Senior Developer
Netresearch GmbH & Co. KG





More information about the TYPO3-dev mailing list