[support] Many menus - complex navigation

J-P Stacey jp.stacey at torchbox.com
Wed May 9 15:27:30 UTC 2007


Hi,

Thanks very much for your reply:

> * how to highlight A, B, C or D (with HTML classes?) and make a
> menu only 2 levels deep
> 
> emm >> If you are using the drupal built in menus, the structure returned by menu_primary_links() is helpful.

That looks almost ideal, actually. I've had to use it as a stub for my own, 
but it's pretty much the mechanism I'm looking for.

The problem I'm having is that frequently I have items which have a natural 
place in the notional hierarchy of my site, but no entry in the menus. So 
there's a trail through open menus that ought to all be open, but they're 
not (because the specific bit of the menu that the page "feels like" it 
falls under isn't the current active item).

While it's possible to fudge things a *bit* with the category module, that 
only works for quasi-static pages: I can't seem to categorise e.g. views or 
the site shop. So I'm currently wrapping my call to menu_tree() with a 
temporary hack to the active item:

	$temp = $_GET['q'];
	menu_set_active_item(myfunc_map_to_effective_active_item($temp));

	/* Menu functions go here, unaware of the hack */

	menu_set_active_item($temp);

It all seems to work, though it feels a bit hairy.

Cheers,
J-P


More information about the support mailing list