Tuesday, January 31, 2012

[Joomla] Execute Modules Manually

Modules are easy to execute given that it can be place anywhere as long you assign it to a specific position but what if you want to display a module within a component?

Here's the code on how to load a single module:
jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('mod_module','modtitle'); 
echo JModuleHelper::renderModule($module);

The downside with this is it won't apply its parameters. I think there's a way on how to do this but I haven't figure it out yet.

1 comment:

  1. try not using prefix mod_ and using & before getting module..

    jimport('joomla.application.module.helper');
    $module = &JModuleHelper::getModule('module','modtitle');
    echo JModuleHelper::renderModule($module);

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...