Page 1 of 1

Announcing MenuManager 1.3 (and How To achieve custom menus for logged in users)

Posted: Wed Mar 28, 2007 3:24 pm
by calguy1000
MenuManager 1.3 has been released, and is in the forge.  It adds two new parameters 'includeprefix' and 'excludeprefix' which can be used in conjunction with the FrontEndUsers and CustomContent modules to customize the menu to only authorized people.

Here's a guide on how to use these new parameters:

Scenario 1:  You have more private pages than public pages
Go into page content, and for each of your public pages add 'pub-' to the beginning of the page alias
In your template, use something resembling this code (ymmv):

Code: Select all

{if isset($customcontent_loggedin) && $customcontent_loggedin > 0}
{menu}
{else}
{menu includeprefix='pub-'}
{/if}
This should result in (when not loggedin), only the pages who's page alias has the 'pub-' prefix being displayed.  Note, you will need to ensure that you tag each of your public pages, not just the parents.

Scenario 2:  You have more public pages than private pages
Go into page content, and for each of your private pages add 'priv-' to the beginning of the page alias
in your template, use something resembling this code (ymmv):

Code: Select all

{if isset($customcontent_loggedin) && $customcontent_loggedin > 0}
{menu}
{else}
{menu excludeprefix='priv-'}
{/if}
This should result in (when not loggedin), the private pages being hidden (because we are excluding any page (and it's children) who's page alias prefix matches 'priv-'.

I hope you all understood this, and can now have a fully flexible menu.

Re: Announcing MenuManager 1.3 (and How To achieve custom menus for logged in users)

Posted: Wed May 30, 2007 10:27 am
by BtB
Maybe a stupid question, but hell, I'll ask anyway!  ;D

I'm using the latest version of CMSMS with FrontEndUser, CustomContent and SelfRegistrationModule.

I was wondering if you can add more "excludeprefix" to the same line.

I've made this code so far:

Code: Select all

<!-- Test Menu -->
{if $ccuser->loggedin() && $ccuser->memberof('Group1')}
{menu template='cssmenu.tpl' excludeprefix='Group2_'}

{elseif $ccuser->loggedin() && $ccuser->memberof('Group2')}
{menu template='cssmenu.tpl' excludeprefix='Group1_'}

{else}
{menu template='cssmenu.tpl' excludeprefix='_'}
{/if}
<!-- Test Menu -->
Which is working exactly to my needs, but now I want to add another Group -> Group3

Anyone has an idea about how to exclude more Groups?

These were not working for me:
excludeprefix='Group1, Group2'
excludeprefix='Group1' && excludeprefix='Group2'

Is there any way, or do I have to tackle this problem with a whole new code?

Re: Announcing MenuManager 1.3 (and How To achieve custom menus for logged in us

Posted: Wed May 30, 2007 1:58 pm
by alby
BtB wrote: Anyone has an idea about how to exclude more Groups?

These were not working for me:
excludeprefix='Group1, Group2'
excludeprefix='Group1' && excludeprefix='Group2'
From help of Menumanager:
excludeprefix="" - Exclude all items (and their children) who's page alias matches one of the specified (comma separated) prefixes. This parameter must not be used in conjunction with the includeprefix parameter.
First case (excludeprefix='Group1, Group2') must be right.
Menumanager version?
And with excludeprefix="Group1, Group2"?

Alby

Re: Announcing MenuManager 1.3 (and How To achieve custom menus for logged in us

Posted: Wed May 30, 2007 1:59 pm
by calguy1000
I believe the latest menu manager allows multiple prefixes (comma separated).

Re: Announcing MenuManager 1.3 (and How To achieve custom menus for logged in users)

Posted: Wed May 30, 2007 2:17 pm
by BtB
Thx for the reply!

I've got MemuManager 1.5 installed.

Code: Select all

excludeprefix='Group1, Group2'
Is not working, it still shows "Group2" in the menu.

Code: Select all

excludeprefix="Group1, Group2"
Is not working either, it still shows "Group2" in the menu.

Either with "_" or without. (Group1_ or just Group1)

Re: Announcing MenuManager 1.3 (and How To achieve custom menus for logged in users)

Posted: Wed May 30, 2007 2:20 pm
by BtB
Erm, I guess the problem was the (space) after the comma! It''s working now, I would have sworn I already tried it though. But it's working!

Code: Select all

excludeprefix='Group1,Group2'
Works perfectly! ;D

Sorry to have kept you busy!  ;)