Mambo Open Source/Different ways of loading modules

From Wikibooks, open books for an open world
Jump to navigation Jump to search
TOC
Chapters
Home
Configuration
Design
Content
Development
Miscellaneous

Load the modules means to put a piece code in the templates index.php file that will be replaced with the modules when run through mambo's template engine. There are some parameters that you can use when loading these modules that load them in different ways.

In this article, all code examples are for the "left" module position. This can be replaced with any position you want.

There are many ways (plain, tableless, wrapped) to load the modules in mambo.

The normal, plain mode[edit | edit source]

This is the most common way to do it, and has no additional parameters, and will load the module in a table. This is how it should look:

<?php mosLoadModules ( 'left' ); ?>

This loads a table with the class "moduletable". The module header, if present, is loaded in a th-cell, whilst the content of the module is loaded in a td-cell.


Module heading
Module content


Without the "moduletable"-table[edit | edit source]

This method echoes the modules content only, without the moduletable-table. This means that the header will be gone too, as the whole table that wraps around the content in the normal, plain mode is gone.

<?php mosLoadModules ( 'left',-2 ); ?>

This is the output it produces:

<div class="moduletable">
<h3>Module Heading</h3>
MODULE CONTENT	
</div>

Wrapped in div-tags[edit | edit source]

This method is identical to the previous one, but wraps it in three addidional div tags. With the right css code applied to it, it is possible to create graphical modules that are dynamic in width and height.

<?php mosLoadModules ( 'left',-3 ); ?>
<div class="module"><div><div><div><h3>Main Menu</h3>
MODULE CONTENT
</div></div></div></div>