How show joomla module in error page.

In error.php page, you need to import the module helper. This can be done by adding this code

jimport( ‘joomla.application.module.helper’ );

Normally we defined module in index.php file jdoc:include type=”modules” name=”menu”
But in error.php it will not work. In error.php you need to call module:

$module = JModuleHelper::getModule( ‘menu’ , ‘Main Menu’ );
$attribs[‘style’] = ‘xhtml’;
echo JModuleHelper::renderModule( $module, $attribs);

where menu = type of the module and
Main Menu = name of the module not ttile.


Joomla : load a module inside a component

To load a module inside a component, just paste below code inside in your component where you want to show the module.

 $modules =& JModuleHelper::getModules('contact');
 foreach ($modules as $module)
echo JModuleHelper::renderModule($module);

Here  ‘contact’ is the module position


Joomla : load a module inside an article

Those who are working in joomla, sometimes u need a module inside an article. Just Paste the code inside an article.

{loadposition myposition}

Here ‘myposition’ is the module position name. Don’t forget to add the curly braces.