Maneesh Mehta
Maneesh Mehta

Reputation: 507

How we include a joomla module in a component view in joomla

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

Answers (1)

Parthi04
Parthi04

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

Related Questions