Separate Nav Menus for Public / Members Using Mega-Menu

Permalink
Hi

Please see attached Sitemap I am working with.

Basically, using Mega-Menu and need to have 2 separate nav menus. One that is viewable to the public visitors (on the sitemap - that is show every page under HOME except Members level at the bottom). Two, after a member logs in, they are redirected to a members only page which now only shows the pages from the Members Level only.

Not sure how to do it, I've been playing with Exclude from Nav in the sitemap properties, and then the Mega-Menu levels and sub-pages, but I just can't get it.

Thanks for your help.

1 Attachment

PatrickCassidy
 
Adreco replied on at Permalink Reply
Adreco
Just off the top of my head; Instead of trying to exclude from Nav, I'd use permissions instead, unless you don't want any of the original menu viewable by members after they log in.
Or, with so few pages to edit, the menu can be put in a non-global area and manually installed on each page from stacks and the one for members set to show only the member pages
This isn't very elegant, but will get you functioning without a lot of effort. I'm pretty sure I've seen other solutions to a similar problem on this forum already.

(Netjunky had a solution for different user groups http://www.concrete5.org/community/forums/customizing_c5/changing-n... but I haven't tried to see if this worked between Public and Member. Also, if members are not discouraged to view the whole site, have you considered using permissions to view the members area and have those pages display a second (sidebar?) menu)
VPenkov replied on at Permalink Reply
VPenkov
There's that, and there's the easier, kinda hacky way.

I'd start off by building my two menus inside two different stacks. I presume you know how to create a stack from your dashboard.
Let's call the stacks guestmenu and usermenu.

Then, inside your template, replace the area in which you've put your menu with the following code:
<?php 
  $u = new User();
  if ($u->isLoggedIn()) { 
   $stack = Stack::getByName('usermenu');
   $stack->display($c);
   }
   else {
   $stack = Stack::getByName('guestmenu');
   $stack->display($c);
   }
?>
The permissions method above would be more elegant, but this will save you some clicking. Not tested, but should work.