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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

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

Post 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.
Last edited by calguy1000 on Wed Mar 28, 2007 7:37 pm, edited 1 time in total.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
BtB

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

Post 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?
alby

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

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

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

Post by calguy1000 »

I believe the latest menu manager allows multiple prefixes (comma separated).
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
BtB

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

Post 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)
BtB

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

Post 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!  ;)
Post Reply

Return to “Modules/Add-Ons”