1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 3 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Developer Manual arrow 11. API Reference arrow mosLoadModules

mosLoadModules PDF Print E-mail

Last reviewed: 2 Dec 2005, Joomla 1.0.4
phpDocumentor

mosLoadModules

Loads the modules in the specified position.

This function loads the module(s) for the position that is specified in the position parameter. If the style parameter is 1 (indicating horizontal module layout) and there is at least one module, then the modules are inserted into a table that has one row.

If the GET variable 'tp' is set to 1, then the function returns after outputting the value of the position variable enclosed in <div> tags. The GET variable 'tp' is used by the adminstration backend to provide a preview of the site with the positions identified.

This function is most apt to be called from a template. For more information on functions that are helpful for template developers, see the Templating Function Reference.

This function does not return a value. Note in all cases that an optional class "suffix" can be applied via the module parameters.

Syntax

void mosLoadModules ( [ string $position [, int $style ]] )

$position
is a string containing the position for which to load the modules. These values coordinate with those setup in Module Positions in the administration backend. This is an optional parameter and if omitted will default to 'left'.
$style
is an integer containing the style in which to display the modules. In Joomla 1.0.3 there are five styles: 1 = horizontal, 0 = normal, -1 = raw, -2 = XHTML and -3 = extra divs. The horizontal style will display the modules in a row. Each module is displayed in the cell of a wrapper table. The normal style is the default and will display the modules in a column. The raw style will display the modules with nothing added and will not display titles. The XHTML style will display the modules inside div tags and header tags. The extra divs style will place extra div tags around the modules to allow for things like stretchable rounded corners. The extra divs style was introduced in Mambo 4.5.2.1. This is an optional parameter and if omitted will default to 0.

Defined in

includes/template.php
(includes/frontend.php prior to Joomla 1.1)

Examples

Example: Loading the modules in the 'left' position using the default style.

mosLoadModules( 'left' );

Example: Loading the modules in the 'right' position and displaying them horizontally.

mosLoadModules( 'right', 1 );

Example: Output of modules that are displayed in a column

<!-- Individual module -->
<table cellpadding="0" cellspacing="0" class="moduletable[suffix]">
  <tr>
    <th valign="top">Module Title</th>
  </tr>
  <tr>
    <td>
      Module output
    </td>
  </tr>
</table>
<!-- Individual module end -->

 

Example: Output of modules that are displayed horizontally. Each module is output in the cell of a wrapper table.

<!-- Module wrapper -->
<table cellspacing="1" cellpadding="0" border="0" width="100%">
  <tr>
    <td align="top">
      <!-- Individual module -->
      <table cellpadding="0" cellspacing="0" class="moduletable[suffix]">
        <tr>
          <th valign="top">Module Title</th>
        </tr>
        <tr>
          <td>
            Module output
          </td>
        </tr>
      </table>
      <!-- Individual module end -->
    </td>
    <td align="top">
      <!-- ...the next module... -->
    </td>
  </tr>
</table>
 

Example: Output of modules that are displayed as raw output. Titles are not displayed.

Module 1 OutputModule 2 OutputModule 3 Output
 

Example: Output of modules displayed in XHTML format.

<!-- Individual module -->
<div class="moduletable[suffix]">
  <h3>Module Title</h3>
  Module output
</div>
<!-- Individual module end -->
 

Example: Output of modules that are displayed with extra divs. This format allows, for example, stretchable rounded corners. This option was introduced in Mambo 4.5.2.1.

<!-- Individual module -->
<div class="module[suffix]">
  <div>
    <div>
      <div>
        <h3>Module Title</h3>
        Module output
      </div>
    </div>
  </div>
</div>
<!-- Individual module end -->

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Tuesday, 03 January 2006 )
 
< Prev   Next >