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

1k Views Asked by At

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

2

There are 2 best solutions below

6
Mayank Sahu On BEST ANSWER

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"   />
8
jonasfh On

If I understand correctly, you should simply be able to duplicate your menu module (in extensions->modules) and add the duplicate module to a module position in the footer of your template. If there is no module position in the footer, you add one to the - list in templateDetails.xml, and add it to index.php in your template, like:

<jdoc:include type="modules" name="footer-menu" style="xhtml" />