Page 1 of 1

FrontEndUsers and MenuManager [SOLVED]

Posted: Wed May 08, 2013 11:43 pm
by tophers
I have an extranet (requires login to view anything) with two types of content - pages for everyone, and pages that are customized depending on the group you are in. The site is getting large, and the navigation a bit unwieldy, so I'm looking to split these apart somehow.

I currently have the following FEU Groups:
All (Everyone belongs to this group, in addition to one of the following)
Group A
Group B

My thought is to let everyone see the same content once they log in - this will the content marked 'All'. In addition, there will be a 'My Resources' link that will switch to a part of the site customized for different groups.

My question is - how to generate a menu for just a specific group? The Protected Pages content type does a wonderful job of handling this all in the background, but I need to have a template (or most likely logic on the page) that generates a menu of content that is only available to Group A - excluding content that is available to All. So that when they click on the 'My Resources' link the menu does something like:

Code: Select all

{if $ccuser->memberof('GroupA')}
{menu category='GroupA'}
{/if}
I realize there is no 'category' parameter for the Menu Manager, but this is roughly what I'm trying to accomplish. Any ideas?

Re: FrontEndUsers and MenuManager

Posted: Thu May 09, 2013 2:20 am
by Dr.CSS
if you put the pages under sectionheaders GroupA, GroupB then you can do...

{if $ccuser->memberof('GroupA')}
{menu childrenof='GroupA'}
{elseif $ccuser->memberof('GroupB')}
{menu childrenof='GroupB'}
{/if}

Re: FrontEndUsers and MenuManager

Posted: Thu May 09, 2013 8:25 pm
by tophers
Turns out it got more complicated (doesn't it always?!). I still have the same FEU Groups:
  • • All (Everyone belongs to this group, in addition to one of the following)
    • Group A
    • Group B
But now some content needs to be shared between Groups A and B, so Dr.CSS's solution won't work as-is. But with a small tweak it does what I need! I've set up my content as follows:
  • • Home
    • Section One
    • Section Two
    • Section Three
    • Resources (everything under this directory requires membership in A and/or B)
Then I set up my main navigation call as follows:

Code: Select all

{$cgsimple->get_root_alias('','root_alias')} <!-- CGSimpleSmarty -->

{if $root_alias == 'resources'} <!-- My dirctory of segmented content -->
    <!-- Shows menu of children pages, MenuManager/Protected Content handle which group sees what -->
    {menu childrenof='resources'} 
{else}
    <!-- Hides the 'resources' content, shows Sections One-Three -->
    {menu excludeprefix='resources'}
{/if}
So if you are logged in at all, you initially see Sections One-Three. A link (with similar logic as above) grants you access to the Resources section, which then reconfigures the nav to show you only those children pages under Resources that you are allowed to see, depending on group. The 'excludeprefix' parameter combined with 'childrenof' solved my problem. Thanks!

Re: FrontEndUsers and MenuManager [SOLVED]

Posted: Thu May 09, 2013 8:47 pm
by Rolf