Warning: Call-time pass-by-reference has been deprecated in /home/content/m/i/k/mikenoel/html/mambots/content/joscomment.php on line 43
Modules In Content
Written by Mike Noel   
Thursday, 06 April 2006
Modules in Joomla! are the little blocks of functionality that usually site around the periphery of a webpage. These little blocks are small snippets of PHP that are executed by the Joomla! engine when rendering a page. The result of the script is displayed as a small block of html on the rendered webpage. Some modules simple display data from the database. Others provide small forms that allow the viewer to take an action. The "who's online" module is an example of the first type and the login form is an example of the second.

Modules are typically displayed on the left and right sides of the page. It's not uncommon to also find modules on the top or bottom of a page. The display location for a module is controlled by the site administrator through the Joomla administrator panel. The module management screen provides several options as possible locations for a published module.

The typical way to include modules on a rendered page is to put php statements in the index.php page (the main template page) that instruct Joomla to include all of the modules for a given position. This method of including modules is fairly static and restricted to all areas on the page that aren't covered by other components. In particular this keeps modules out of the content area of a page.

Joomla provides a way to get around this limitation through the use of a built-in plugin. The plugin allows authors to insert the "load module" command at any point in their content. The author simple has to include the text

{mosloadposition user9}
in their content at the location where they want the modules to appear. Including this text will instruct Joomla to load all of the modules designated as belonging to position "user9" into the content. Of course any position identifier can be used here.

This handy trick allows the insertion of author profiles, related articles, or any other interesting information into the main body of any article.

Last Updated ( Saturday, 08 July 2006 )