This entire post came about due to a great screencast by Addison Berry about using secondary menus. If you haven't already seen the screencast or you don't understand how to make the children of the primary navigation show up as the secondary navigation then you must watch the screencast.
I'll come out and say it, before watching this screencast, I didn't even know using the children of the primary navigation as a secondary menu was even possible. I had always used the secondary navigation for things like footer navigation and created individual menus for the various sections of the site and placed each block.
UPDATE: Since writing this post I've tried it out in a real world scenario and found it to have some issues. I recommend you read the followup that talks about why this methodology is flawed.
Old Method (individual blocks per menu)
Pros
- Adding pages to various menus other than the primary is easy
- Uses the block system so there is some added flexibility
- Users can create menu items where ever they want
Cons
- Each menu for each section must be created separately & manually
- The user has to see the entire menu selection to find the right menu
- User can see both the primary links and the menu you created in the menu selection (confusing)
- The user can create the menu where ever they want
- Adding a new section to the site is fairly labor intensive for users (add primary link, add menu, tie block to the page/section)
New Method (Using secondary nav from the primary nav)
Pros
- Users don't have to create a different menu for the sections (even the new ones)
- When properly configured, the user can only see the primary links tree
- Adding new sections to the site easy (due to only having to add it to the primary nav)
Cons
- Menus are limited to the Primary nav (when properly configured and there is a way around this)
- The location of the secondary navigation must be placed in the page.tpl.php which limits it's functionality.
Now the point of this post isn't actually to weigh the differences of the two methods. They both have their pros and cons. What I had dreamed up after watching the screencast was tieing Pathauto into the new method so I could abandon using taxonomy to create a virtual directory structure.
While using a separate taxonomy and menu system is easy for tech savy users the truth is most users don't understand why they have to change two separate settings to make it show up in a menu and have the proper url structure. My idea/solution was to use the tokens [menupath-raw]/[title-raw] in Pathauto to define the path of the path of the node completely on the menu path and hopefully eliminating the hierarchy taxonomy from nodes that don't need to use it. While my concept was sound it turns out [menupath-raw] includes the full menupath including the page you are currently on which ended up giving me a double title.
Example Menu Structure:
- About
- The Company
- Our Staff
- Abe Vigoda
Using the [menupath-raw]/[title-raw] pathauto the path to the "Our Staff" page would end up displaying as /about/our-staff/our-staff which isn't how I envisioned it. My next attempt was a simple one, remove the [title-raw] and just leaving the [menupath-raw] to define it's self. It turns out this fix was the magic one since it did fix the problem, with one caveat. The only caveat is you can't use this method on pages that aren't defined in a menu. For the most part this caveat shouldn't stop you since you should have setup your pathauto and cck properly and nodes that aren't menu-bound should have their own rules setup that don't require a menupath. Remember, if you are just creating a general page that isn't in some type of menu then you are most likely deviating from your Information Architecture and you should most likely re-think your page or your IA.
There will be a few times that you have a good reason not to have a page in your menu while still following your IA and CCK/Pathauto best practices. That's ok, it happens :) just use the taxonomy method for Pathauto and everything should work out, it's just not as easy for the user.
tl:dr version
When you crate menus, build them off the primary navigation (including children). Then use your secondary-navigation to have the menus show in sections. After setting up all of that, set your Pathauto to use [menupath-raw] on your page content type. Now adding a new section is as easy as adding a menu link to the primary navigation. If this method won't work for your situation then don't use it.
Comments for this post are
Comments for this post are closed. If you wish to post, please post in the followup post.