Mambo provides a number of options for module display on your site. In this article we look at the basic module display options provided by Mambo itself.
Controlling Module Display in your Mambo Template
In your template's index.php, modules are placed by the use of code, such as this (this example determines the position of any published module that is set to the "top" position:
<?php mosLoadModules('top');?>
When a module is called in the index.php, there are five options on how it is displayed. The syntax is:
The style string (ie. $style)is optional - you do not have to specify this at all. However, if you wish to have greater control over how modules are displayed in your template's index.php, you can use any of the following styles: 0, 1, -1, -2 or -3.
The Options
0 = (default display) Modules are displayed in a column.
There is no need to use "0" in your index.php as any module that does not have any of the other options assigned automatically defaults to this setting.
Example:
This Outputs:
Input argument $style will be set to 0 and modules are displayed vertically.
Each module is wrapped in <table class="moduletable"></table> tag as seen below:
1 = Modules are displayed horizontally. Each module is output in the cell of a wrapper table.
Example:
This Outputs:
Modules are displayed horizontally, each module wrapped in <table class="moduletable"></table> tag, as seen below:
-1 = Modules are displayed as raw output and without titles.
Example:
This Outputs:
Only the content of each module is shown (no title) and each module is not wrapped
inside any table/div.
-2 = Modules are displayed in CSS format enclosed by a <div>.
It is up to you to style the DIV (floating, background colours, etc.)
Example:
This Outputs:
Each module is wrapped in a <div class="moduletable"></div> tag, as seen below:
-3 = Modules are displayed in a format that allows for unique .css styling applying to just that particular class.
When this styling is applied, the div class changes from "moduletable" to "module" and modules are displayed using <div class="module"></div> tags.
The additional divs allow for more CSS flexibility and were included in response to user requests for easy styling for graphical elements, such as rounded corners.
Example:
This Outputs: