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 a module on all menu items under one menu?

Show a module on all menu items under one menu?

Hello,
I have been using Metamod a lot and i love it! Thanks!
Now i wonder if there is a way to show a module on all menu items under one menu? For example:
I have a module called "car picture slideshow", then i have four different menus on the site, like "main menu", "user menu", "menu3" and "menu4". Is it possible to make "car pictures slideshow" show on all menu items under "menu3"?

Thanks!

lukas85
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Show a module on all menu items under one menu?

Hi lukas85,

That's a good question. There's a recipe on the Recipes page that almost does what you want - see Show Modules on Submenus of a Menu Item for details.

In order to use that one for your purposes, you would need to set it up with all the Itemids of the "top level" of the menu. So if your menu3 has menu items "item1", "item2", "submenu1", "item3" then you would need to set it up with the Itemids of those 4 items, which is still more work than you wanted to do! (At least it would automatically handle all the submenu items in submenu1).

So, how to do what you are asking for:

Code:

$menu = &JSite::getMenu();

if (empty($Itemid)) {
  $menuItem = &$menu->getActive();
} else {
  $menuItem = &$menu->getItem($Itemid);
}
$menutype = @$menuItem->menutype;
if ($menutype == 'mainmenu') return 101;
if ($menutype == 'usermenu') return 102;
if ($menutype == 'menu3') return 103;
if ($menutype == 'menu5') return 104;
/* replace 101, 102, 103, 104 with the module numbers to display on those menus */

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
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4388
Newest User:
wilmer7878
Members Online:
2
Guests Online:
139


Forum Legend:

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