Disclaimer

I just brought the site back to life so that people can stop reminding me that it's down. Please note that probably most if not all content is outdated. I'll try to update stuff as soon as possible.

best Ingo

Adding a new plugin to an existing extension

There might be a point sometime when you have writen an extension already but you need new functionality which would require to put it in a new plugin. This is going to be a small tutorial on how to add a new plugin to an already existing TYPO3 extension.

An Example

I will do this example with timatb where I'm going to add a nplugin which shows a small calendar. The calendar will highlight the days where post have been made. As code for that already exists the code will be taken from wordpress and modified to fit into TYPO3.

Add a new plugin folder



Add the files

Depending on what the plugin will do you need to add files.

Making the plugin visible in TYPO3

The last thing is to add some configuration to the extension so that TYPO3 recognizes the new plugin.

ext_localconf.php

t3lib_extMgm::addPItoST43($_EXTKEY, 'pi3/class.tx_timtab_pi3.php', '_pi3', 'list_type', 1);

ext_tables.php

$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi3'] = 'layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:timtab/locallang_db.php:tt_content.list_type_pi3', $_EXTKEY.'_pi3'),'list_type');

if (TYPO3_MODE=="BE") {
    
$TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_timtab_pi3_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi3/class.tx_timtab_pi3_wizicon.php';
}

locallang_db.php

$LOCAL_LANG = Array (
    
'default' => Array (
...
...
...
        
'tt_content.list_type_pi3' => 'Calendar',
    ),
);

locallang.php

$LOCAL_LANG = Array (
    
'default' => Array (
        
'pi3_title' => 'Calendar',
        
'pi3_plus_wiz_description' => 'add a small calendar which highlights the days where you have made some posts',
...
...
...
    ),
);

Add code

Now all that is left is to add code to the new class.tx_timtab_pi3.php.