[support] Many menus - complex navigation

jp.stacey at torchbox.com jp.stacey at torchbox.com
Tue May 8 08:41:47 UTC 2007


Hi,

I've got much of the functionality together that I need from Drupal,
except the client would now like quite structured menu navigation and I
was wondering how I would accomplish this in the least hacky way.

The site is divided up into sections with the category module, although
final "pages" are often views rather than nodes, so (I think) they can't
be categorised and hence put in a section directly. There's four to five
layers of sections, and the end pages don't have to appear in the
navigation themselves (except when they're what you'd call "index" pages).

My problems are specifically at the view layer - putting the overarching
menu together in admin isn't too hard. Any suggestions on the following
requirements gratefully received:

1. Across the top, two layers deep into the section hierarchy:

	A	B	C	D
	(Hidden dropdowns:)
	a1	b1	...
	a2...	b2...	...

2. Down the left-hand side, the second and subsequent layers of the
*current* section's hierarchy. So if you're in top-level section B:

	b1
	b2
	  b2-1
	  b2-2...
	b3...

This would need to adapt depending on what section the user is
navigating in (so in section A you'd just see a1...aN).

3. Current top-level-section (A, B, C or D) highlighted, and current
sub-sub-...-section expanded on the left-hand side, all the way down.

I can force sections for non-sectioned pages in template.tpl.php - I'm
already doing it, sort of, for one of the views - but it'd be good to know
how to do the above with the least PHP. Specifically:

	* how to highlight A, B, C or D (with HTML classes?) and make a
	  menu only 2 levels deep
	* how to choose a submenu, and how to expand just the leaves
	  (leafs?) that lead you down the tree to e.g. b2-3-1, given that
	  sub-sub-sub...section (so generating a menu 2-to-X levels deep)

Many thanks in advance!

Cheers,
J-P


More information about the support mailing list