Mainnavigation as Modulposition

GK User
Tue Apr 27, 2010 8:47 pm
Dear Support team,

how i can have the mainmenu as a Modulposition? Couse i want if a not registred user joins on the page it will be shown an other mainmenu than for the registred users. But for this i need the Mainnavigation as a Modulposition

for this i use the Metamod modul.

Or you have other ideas to realize this?




thanks in advance

best regards
4ndreas
User avatar
Junior Boarder

GK User
Wed Apr 28, 2010 1:41 am
Hi

Well, you can go to "Menu Manager", select "Main Menu" and copy.
Them add a different "New Menu Title" and (naturally, very important) different "New Menu Module".

Now you can use this menu ID in any mainmenu module.

If you want to use "mainmenu" ID on some module, them you must go to "Template Parameters > Menu > Menu Module" and select your menu to use on Megamenu position.

They must not be the same, because (and of course) any change on the module will effect the menu on Megamenu position.

Cheers ;)
User avatar
Platinum Boarder

GK User
Wed Apr 28, 2010 7:36 pm
hi Seichinha,

thx for help, but i wanted 1 menu for unregistred and 1 for registred. I wrote it now in the index.php of the template:

after:
Code: Select all
$gkmenu = null;


Code: Select all
   
$user =& JFactory::getUser();   
    $user_id = $user->get('id');   
    if ($user->get('guest') == 1)    { 
      $meinmenu = 'othermenu';
      }
    else
    {
       $meinmenu = 'mainmenu';
    }



instead of:
Code: Select all
$gkparams->set( 'menutype', $tmpl->getParam('menutype', 'othermenu') );


i call the the variable $meinmenu
Code: Select all
$gkparams->set( 'menutype', $meinmenu );


this works for me fine.

best regards
4ndreas
User avatar
Junior Boarder


cron