Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Templating

Mambo Manual is part of the documentation project for the Mambo open source content management system

Toggle Sidebar

Module Display Options


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:

mosLoadModules('$position_name'[, $style] )

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:

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

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:

<table cellpadding="0" cellspacing="0" class="moduletable">
  <tr>
    <th valign="top">Module Title</th>
  </tr>
  <tr>
    <td>
      Module Content
    </td>
  </tr>
</table>



1 = Modules are displayed horizontally. Each module is output in the cell of a wrapper table.

Example:

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

This Outputs:
Modules are displayed horizontally, each module wrapped in <table class="moduletable"></table> tag, as seen below:

<table cellspacing="1" cellpadding="0" border="0" width="100%">
  <tr>
    <td align="top">
      <!-- First Module -->
      <table cellpadding="0" cellspacing="0" class="moduletable">
        <tr>
          <th valign="top">Module Title</th>
        </tr>
        <tr>
          <td>
            Module Content
          </td>
        </tr>
      </table>
      <!-- /End First Module -->
    </td>
    <td align="top">
      <!-- Second Module + -->
    </td>
  </tr>
</table>



-1 = Modules are displayed as raw output and without titles.

Example:

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

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:

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

This Outputs:
Each module is wrapped in a <div class="moduletable"></div> tag, as seen below:

<div class="moduletable">
<h3>Module Title</h3>
Module Content
</div>



-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:

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

This Outputs:

<div class="module">
<div>
    <div>
      <div>
        <h3>Module Title</h3>
        Module Content
      </div>
    </div>
  </div>
</div>
Toggle Sidebar
Space Navigation
Added by Lynne Pope on 28 Dec, 2007 01:44, last edited by Lynne Pope on 15 Oct, 2008 16:08

Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license