Different GK Extra Menu's on different pages

Premium, Furniture Joomla Design Shop Template with K2Store support
GK User
Sat Oct 13, 2012 4:51 pm
Hi There,

I have a problem. I am not sure that this is the correct section to post it in but I will give it a go and please let me know if I should move it.

I hope that I am explaining myself correctly :).... I am currently using the B&W template with Joomla 2.5 ( latest ).

My site requires different menu structures on different sections of the site ( kind of a sub site thing )

So, on URL www.mysite.com I need the main menu. On a specific article (or category) for example (www.mysite.com/locations), I need to show a different different menu structure.

My problem is with the template, the display of the menu is generated.controled through the template management interface, rather than through a module position ( As I have seen with other/older template and menus ).

I have tried creating multiple menus, adding a template position, and wrapping the GK Extra menu code in nav.php with conditional mod code:

Code: Select all
<?php if( $this->modules('nav')) : ?>
   <?php if($this->getParam('show_menu', 1)) : ?>
   <div id="gkMainNav">
      <div id="gkMenu">
         <?php
            $this->menu->loadMenu($this->getParam('menu_name','mainmenu'));
            $this->menu->genMenu($this->getParam('startlevel', 0), $this->getParam('endlevel',-1));
         ?>
      </div>
      
         <?php if($this->generateSubmenu && $this->menu->genMenu($this->getParam('startlevel', 0)+1, $this->getParam('endlevel',-1), true)): ?>
         <div id="gkSubNav">
         <div id="gkSubmenu">
              <?php $this->menu->genMenu($this->getParam('startlevel', 0)+1, $this->getParam('endlevel',-1));?>
         </div>   </div>
         <?php endif;?>
   
   </div>
   <?php endif;?>
<?php endif; ?>



This allows me to turn it on and off with module positioning but obviously because code that generates the menu uses parameters from the template ( including the menu name ) it always generates the same menu selected through the template management section.

Is there a way that I can use GK Extra Menu like a standard menu module so that I can assign it to a position and assign a specific menu through the menu manager? Or is there another better way to achieve what I need and have different main menus on different pages ( preferably without duplicating the template and assigning different templates to different sections. )

Any thoughts or help would be appreciated.

Regards

Michael Tull
User avatar
Fresh Boarder

teitbite
Sun Oct 14, 2012 2:50 pm
Hi

You can replace menu with a module position, but all styling and megamenu functionality will be lost. So I think one of many ideas can be (I would use that) to have all this menus in one big menu, but each menu item should have attached css class. Than using mod_blank with a css code attached to desired pages and hiding all other menu items. I think this solution is the fastest in this circumstances.
User avatar
Moderator

GK User
Sun Oct 14, 2012 3:44 pm
Hi teitbite; and thanks for getting back to me. I understand what you are suggesting, but unfortunately, that wont work for me very well, as it would make a HUGE menu as there are about 20 'sub' sites / sections for different franchisees, and each of the only share 3 of the items in the top level menu, so it would get really complicated, and hard to maintain in the future as things change.

I have been doing some looking around, and I think I have come up with a solution that will actually work better than I had hoped for. I have researched and now understand template styles :) I can create seperate styles for each franchisee, create 20 different menus, that can be individually managed / added to etc., and then using a tool called Chameleon ( the new version of meta template ) I can assign that template style based on a session cookie. It took me a little reading to understand but this will allow me to have almost completely separate 'sites' that can still share the one major part of the site which is the products so that section only has to be maintained once!

Anyway, thanks again for your suggestion as it will actually come in handy for another site I am working on.
User avatar
Fresh Boarder

teitbite
Mon Oct 15, 2012 11:42 am
Hi

I believe there is also a fastest way to customize menu code. This will require some work with PHP, but as a result a different menu will be selected for different pages. Page will need to be coded insode the file, but with this solution only one template will be needed.
User avatar
Moderator


cron