Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

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>
like image 388
Maneesh Mehta Avatar asked Sep 01 '12 06:09

Maneesh Mehta


People also ask

How do you call a module in Joomla article?

Type in the position myposition and press enter instead of selecting it from the drop-down list. Assign the module to All the Menu Items. This will make sure that it always appears, no matter how the visitor got to the article. The module will not show unless you put the command to load the module in an article.

What is module in Joomla?

Joomla! modules are lightweight extensions or “widgets” that can be inserted into a page to display specific types of pre-configured content. Typical examples include the login module, latest news module and banner module.


1 Answers

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);
    }
like image 185
Parthi04 Avatar answered Nov 09 '22 16:11

Parthi04