| [Joomla Tutorial] How to put a new module position in your Joomla template |
|
|
|
In Joomla template, the PHP template is combined with HTML. When you installed new Joomla template at you administrator, it's already have declared the module position. You can go to Administrator (Site --> Preview --> Inline With Positions) to view this position. Figure below show some module position example: Each module position represent Joomla module (Modules --> Site Modules). This module can be relocated example : You can move "Latest News" module from top to right position. This figure below shows how it can be relocated: You also can add up to 50 modules position with you own string. This setting can set at Site --> Template Manager --> Module Position On, default Joomla installer, they list only 27 editable module position. The rest, is up to users. After you know about the Joomla module position, we will now show you how to implement this module to your own custom template. First you need to know the default format of PHP code for Joomla module : <?php mosLoadModules ( 'module position' ); ?> In that code, module position come from the string value of position in module position table. This example of code shows how the string implemented from the table: <?php mosLoadModules ( 'left' ); ?> <?php mosLoadModules ( 'right' ); ?> <?php mosLoadModules ( 'top' ); ?> <?php mosLoadModules ( 'bottom' ); ?> <?php mosLoadModules ( 'user1' ); ?> <?php mosLoadModules ( 'user2' ); ?> <?php mosLoadModules ( 'user3' ); ?> <?php mosLoadModules ( 'user4' ); ?> Next, after you decide to use which string module, we will show how this code works in HTML template. Let's say we use this string : header, top, user1, user2. Then we make a simple HTML and locate the position for each module: __________________________________________________________ <html> <p align="center"><?php mosMainBody(); ?></p> </td> _______________________________________________________________ Then we copy paste this code to your current HTML code that you want to edit at Site --> Template Manager --> Site Templates. Choose the template package that you want to edit then click at Edit HTML. After you paste the code, you can view your new edited template with new module position at Site --> Preview --> Inline With Positions. Before that you must make it as a default template. Here is the result from the code: After that, you can show which Module (Modules --> Site Modules) you want to display at the available position. Let's say we want to display this module: Header ---> JoomlaSpan Google Adsense 2.0 Top ------> Members Login user1 ----> Polls user2 ----> Users online Finally, after enable all the modules, the figure below shows the result: Attention, for the main contain to display you must embed this code in your HTML Template code: <?php mosMainBody(); ?> Without this code, all your article in your content item cannot be displayed.You also can edit your CSS file after editing your HTML.
|








