The Art of Joomla is a free magazine about Joomla!(TM) 1.5 for users, web masters, designers and developers alike.

Artisan: a skilled worker who practices some trade or handicraft.

The Artisan's Directory is a free community directory for amateurs or professionals that can somehow help you get more out of your Joomla! website.

Sponsors

Banner
Banner
Google Groups
Joomla! User Group Brisbane
Visit this group
Home Magazine More Menu Tricks – the Split Menu Technique
Issue 2

the Art of Joomla - Web Master Moments

More Menu Tricks – the Split Menu Technique

Written by Andrew Eddie

Many template designers have included what we called a “split menu” technique by providing some extra functions within their template. While this worked, it wasn't very flexible because you were generally limited to where you could put the respective menus. Well, in Joomla 1.5 we change all that.

How the split menu works is that you have, for example, one main menu with menu sub-menus. Your template may include a “top” menu bar that lists all of the top level menu items. When you click on one of the menu items, the split menu highlights the top menu item and only displays the sub-menu items in one of the side module positions.

The menu module in Joomla 1.5 supports two new menu parameters – start level and end level. This allows you to control the levels shown relative to the active menu item. Here are the steps for setting this up.

  • Create a your menu as normal, including sub-menu items as required for your site.
  • Create a new Menu Module. Place it in the menu position that is for your top menu bar or your main navigation (styling of that menu is up to you). Select the menu. Now, in the parameters set the start and end level to 1. This module will probably be displayed on all pages. Publish and save that module.
  • Create a second Menu Module. Place it in one of your columns where you want the split menu to appear. Select the same menu as for the other module. In the parameters for this one, set the start level to 1 and the end level to, say, 3. This module will probably be displayed on all pages as well. Publish and save the module.

Now have a look at your site and cruise around the main navigation menu. All going well, you will see the sub-menu appear in the right place, and the top level menu item will be highlighted as well (if your template supports that).

One of the reasons you use this technique is that you can maintain a single main menu tree with two extra support modules. Previously you could achieve most of this effect with multiple menus and multiple modules assigned to specific pages but you lost the ability to highlight the active menu item, and there was a lot more administration overhead to set it up. This is just one of several improvements that make life easier when you are setting up your site. I hope you enjoy using it on yours.

(91 Votes)

9 Comments

  1. jimb0 makes this comment

    This may just save my life, thanks for this. I was using the extended menu component, but this looks like it will work better. Good Tip.

    Fri 07 Mar 2008 10:47:42 CST

  2. Sundar makes this comment

    You are a dude! This is very cool and works great! Thanks for sharing, I was having some strange problems setting up a split menu and this is ace and simple way of doing it.

    Wed 19 Mar 2008 10:04:18 CDT

  3. Kim Brebach makes this comment

    Hey this is a fundamental improvement from a developer, administrator and client satisfaction POV. Awesome that its core. Awesome.

    Tue 08 Apr 2008 17:52:32 CDT

  4. Zorak makes this comment

    Good extension!

    Wed 30 Apr 2008 09:03:46 CDT

  5. soundbite makes this comment

    Looks interesting. Would like to know what templates are available for it.

    Thu 01 May 2008 13:12:45 CDT

  6. Andrii makes this comment

    One of the reasons you use this technique is that you can maintain a single main menu tree with two extra support modules. Previously you could achieve most of this effect with multiple menus and multiple modules assigned to specific pages but you lost the ability to highlight the active menu item, and there was a lot more administration overhead to set it up. This is just one of several improvements that make life easier when you are setting up your site. I hope you enjoy using it on yours.

    Thu 01 May 2008 13:27:36 CDT

  7. ted makes this comment

    Thanks for such a great ext.

    Thu 01 May 2008 21:26:51 CDT

  8. Mauricio makes this comment

    Bueno modulo joomla

    Thu 01 May 2008 22:48:21 CDT

  9. REllo makes this comment

    nice comment componenet :)

    Wed 07 May 2008 20:41:57 CDT

Add a Comment