Configuring the module
First of all, we have to set up the configuration file of our module. When TYPOlight is initialized, each module configuration file is loaded allowing you to overwrite existing settings. Thus, you never have to modify any core files and your settings will not be overwritten on a live update. Now, please create a file named config.php and add the following lines:
PHP-Code:
1 <?php
2
3 // Back end module
4 $GLOBALS['BE_MOD']['content']['cd_collection'] = array
5 (
6 'tables' => array('tl_cds'),
7 'icon' => 'system/modules/cd_collection/icon.gif'
8 );
9
10 // Front end module
11 array_insert($GLOBALS['FE_MOD']['miscellaneous'], 0, array
12 (
13 'cd_collection' => 'ModuleCdCollection'
14 ));
15
16 ?>
Ok, let's see what we have done here. First, we have added a new back end module called cd_collection to the content group. It uses one table called tl_cds and an icon which does not exist yet. Then, we have added a new front end module called cd_collection to the miscellaneous group.
If you use the array_insert function to add a new back end or front end module, you can define its exact position. In our example, we are using the function to make our module the first one within the group.