Return to Snippet

Revision: 28231
at July 5, 2010 03:09 by jacobpdq


Initial Code
<?php
require_once(JPATH_ROOT.DS.'libraries'.DS.'joomla'.DS.'application'.DS.'module'.DS.'helper.php');
$document =& JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$db =& JFactory::getDBO();
$db->setQuery("SELECT * FROM #__modules WHERE position='positionname' AND published=1 ORDER BY ordering");
$modules = $db->loadObjectList();
if( count( $modules ) > 0 )
{
  foreach( $modules as $module )
  {
    //just to get rid of that stupid php warning
    $module->user = '';
    $params = array('style'=>'xhtml');
    echo $renderer->render($module, $params);
  }
}

Initial URL
http://jeffchannell.com/Joomla/load-a-joomla-module-position-without-using-jdoc-tags.html

Initial Description

                                

Initial Title
Load Module Outside Template

Initial Tags
template, module, joomla

Initial Language
PHP