Table of Contents

getModules

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JModuleHelper Method getModules Reference getModules() Never Work in Progress

Get modules by position

Syntax

array &getModules ( $position )

$position string The position of the module

Examples

Example

$modules = &JModuleHelper::getModules('top');
foreach (array_keys($modules) as $m) {
    echo JModuleHelper::renderModule($modules[$m]);
}

The example might render the following HTML snippet (possibly generated by the mod_newsflash module):

Example output

<table class="contentpaneopen">
  <tr>
    <td valign="top" colspan="2">
    Joomla! 1.5 - 'Experience the Freedom'!. 
    It has never been easier to create your 
    own dynamic site. Manage all your content 
    from the best CMS admin interface and
    in virtually any language you speak.
    </td>
  </tr>
</table>

This is essentially the same as using <jdoc:include type="modules" name="top" style="none" /> in the site template.