Skip to content

Instantly share code, notes, and snippets.

@2dpi
Last active October 7, 2015 06:47
Show Gist options
  • Save 2dpi/3121769 to your computer and use it in GitHub Desktop.
Save 2dpi/3121769 to your computer and use it in GitHub Desktop.
JOOMLA: load module position
<?php if(count(JModuleHelper::getModules('module_position_here'))) :?>
<!-- only show if modules assigned -->
<?php
// define module position
jimport( 'joomla.application.module.helper' );
$modules = &JModuleHelper::getModules( 'module_position_here' );
foreach ($modules as $module) { //loop through the array and render their output
$_options = array( 'style' => 'raw' );
echo JModuleHelper::renderModule( $module,$_options );
}
?>
<?php endif; ?>
// OR USE NO-NUMBER MODULES ANYWHERE PLUGIN - e.g. {modulepos xxx|style}
// OR USE CORE PLUGIN - e.g. {loadposition xxx}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment