Reputation: 507
I am working in a Joomla site I want to include a module inside a component view anybody help me. I am using this code it display unauthorized access message.
<div class="used_image">
<?php
include($mosConfig_absolute_path."/modules/mod_MODULENAME/mod_MODULENAME.php");
?>
</div>
Upvotes: 6
Views: 9789
Reputation: 1151
Try this
jimport('joomla.application.module.helper');
// this is where you want to load your module position
$modules = JModuleHelper::getModules('header');
foreach($modules as $module)
{
echo JModuleHelper::renderModule($module);
}
Upvotes: 13