FrontEndUsers and MenuManager [SOLVED]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

FrontEndUsers and MenuManager [SOLVED]

Post 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?
Last edited by tophers on Thu May 09, 2013 8:25 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: FrontEndUsers and MenuManager

Post 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}
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

Re: FrontEndUsers and MenuManager

Post 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!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: FrontEndUsers and MenuManager [SOLVED]

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”