views:

299

answers:

4

I've had this issue numerous times on sites using drupal and not really found a way that feels right when building menus. Take an example such as this

Primary Navigation [i.e. top of the page]

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5

Then within each Item there would be a secondary menu specific to it:

Item 1 Pages

  • Link 1
  • Link 2
  • Link 3

Item 2 Pages

  • Link 1
  • Link 2
  • Link 3

The links on item 1 and item 2 are not the same, thus they have to be independant of each other.

I think it's standard navigation for site, primary navigation and localised secondary navigation.

What is the "Drupal" (or correct?) way of doing this?

A: 

I don't really get the root of the problem...

Go to /admin/build/menu, where you can add a new menu or modify an existing one (drag and drop, can't be easier).

When adding new content, you can also specify its parent as a menu (sub)item, so that it's inserted in the menu straight away.

Have a look at the navigation menu - the entire administrator menu/submenu set is an example of how it would look like ;)

mingos
this is a little too basic for what i'm looking for answer wise, i've been developing with drupal for a while, and i know the menu interface, it's really when creating customized templates, what functions would you use to render your menus correctly under your own custom html/css/js. question is more about threading everything together
Shadi Almosri
Oh, OK. Well, I think you could try downloading Artisteer and exporting a theme. The generator is very basic and has a few bugs, especially with Drupal themes, but has some nifty rendering code that's worth investigating. I've been using it as a reference, along with other themes that I like.
mingos
+2  A: 

install the Module "Menu block", and be done with it. You owe me a pint. :-)

Jonas
A: 

You may want to consider the Cutemenu module to save yourself some work. I've used it with success and little work effort. Just use Primary for all of your links, and then use the nesting feature of Menus to put the proper submenu items under each main item. After that, it's just a matter of customizing the CSS to match your theme (the default Cutemenu styling is pretty awful).

Nicholai
A: 

If the problem is just that you want an easy way to have local navigation, then Drupal makes that simple. Just put all your items into one hierarchical menu (Primary Links will work fine, but it doesn't really matter), then go to /admin/build/menu/settings. On the bottom option, "Source for the secondary links", you'll see a note:

"You can choose the same menu for secondary links as for primary links (currently Primary links). If you do this, the children of the active primary menu link will be displayed as secondary links."

Therefore, just change Source for Primary Links and Source for Secondary Links to the menu you just added all your items to, and then in your theme, print primary links where you want your top level nav to go and print secondary links where you want your local nav to go.

Mike Crittenden

related questions