Search code examples
joomlajoomla3.0joomla-extensionsjoomla-templatejoomla-module

How to load a menu module in header and footer in joomla?


I have attached joomla's Menu module in my template. But I needed it to load in footer position at the same time. So that if I add another menu it should be get added in both the positions in Header and in the footer... What i want to do to load a menu module to two different positions in a page, in header and in footer.

I had tried to add multiple positions in administrator section for a menu module...

screen shots are as follows

enter image description here

enter image description here


Solution

  • For latest version. Joomla3.x : Get all the modules by template position(replace position with your template position):

    <?php
    $modules  = JModuleHelper::getModules("position");
    $document = JFactory::getDocument();     
    $attribs  = array();
    $attribs['style'] = 'xhtml';
    foreach ($modules as $mod) {
      echo JModuleHelper::renderModule($mod, $attribs);
    }
    ?>
    

    Other Solution: you can define position in the template and assign module to that position

    Steps: 1.Customize templateDetails.xml file add newposition

    2.create position in index file of template in templates/your_template/index.php

    <jdoc:include type="modules" name="newposition"   />