Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Show submenu item when condition is true

Show submenu item when condition is true

Hi, I have a main menu, with a submenu item.  I do not use Joomla users, instead I use directphp and my own user system because I have 3 types of users.  Basically what I am trying to achieve:

Mainpage with no users logged in show 3 options:
Login (No submenu items should show)
Login for Managers (No submenu items should show)
Login fir Super admin (No submenu items should show)

When the users are logged in the following submenu's should show:

Login - (Item1, Item2, Item3)
Login for managers - (Item1, Item2, Item3)
etc.

My code looks like this:

Code:

if ($_SESSION['auth']) {  

return 51,52;
}
if ($_SESSION['authman']) { 
return 76,77;
}

where the 76,77 is the sub menu items

wilest
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Show submenu item when condition is true

MetaMod does not have direct control over individual menu items showing up in other modules. Basically it can just decide which other modules to display or not.

If you are using the standard mod_mainmenu modules to display your menus, then I made a drop-in replacement for mod_mainmenu called "Elastimenu". What you can do with Elastimenu is when you set it up, you can tell it some of the menu items to NOT display.

So what I'd do in your case is to create several Elastimenu modules, one for each situation (with different items not showing).

Then, use MetaMod to select which *module* will display or not.

Elastimenu is free and available from http://www.metamodpro.com/software/elastimenu

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11540
Newest User:
caron5112
Members Online:
1
Guests Online:
128

Online: 
caron5112

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked