Subnavigation, best practices -- help

Events happening in the community are now at Drupal community events on www.drupal.org.
Diegen's picture

Im struggling to wrap my head around which or rather how to construct menus for content heavy and simplistic (brochure) sites. I have a friend who recommends I use books for both. Only use new content types for pages that function differently or do not have the same fields. From a users (editor role) point of view it works really well, since there is way less clutter (not seeing all the primary nav items and subitems) when trying to add a new page to your site structure, and it works really well by using a book menu block per page.

I am wondering how others do it. I have found that true to my friends advice this is very simple to do, works well, is straight forward and is part of a default install - no mods needed.

How do others do it ?

As an example, here are two pages with different submenus per section.
http://humanorigins.si.edu/research/climate-research/effects
http://humanorigins.si.edu/evidence/behavior

and another
http://www.museumofflight.org/exhibits/permanent

last one
http://www.wri.org/climate

Comments

use the power of views

idcm's picture

The menu system is great when you have a fixed or seldom growing set of "static" content nodes. The book module is great when you have a lot of nodes that have parent-child-grandchild relationships versus sybling relationships. On sites where you have people posting a lot of content on a regular basis, views can be your friend.

Create a view that lists all nodes that meet specific criteria. List them in a block. Turn the block on and tada, instant menu that updates automatically when a node is added. If the list is too long for the block, you can add a more link to a view page that continues the list of node links.

This section (http://planningdrupalsites.com/guide/requirements/content-analysis) of planning drupal sites goes over understanding your content. This section (http://planningdrupalsites.com/guide/create-design-plan/identify-page-co...) addresses several items including navigation. These two sections work hand-in-hand. The planning site is a demonstration of the power of using the book outline but it is not always the best solution.

I assume others will jump in with other ways to create menus but maybe this will give you some ideas on how to think about your navigational approaches given the type and nature of your content.

H Idcm! I think the sections

Diegen's picture

H Idcm!

I think the sections as per above are static but also hierarchies of content. I was thinking views would be great too, but take a little longer to setup than using books.

In your opinion how do you think the links I gave about achieved their menus ? With views ?

Thank you for the links

Source code can reveal ideas

idcm's picture

When I look at the source code for the Smithsonian pages, I see code that suggests they might be using Solr Integration with Drupal, a hierarchical taxonomy for the facets (of course), Panels for layout (and maybe more), and views. I wouldn't be surprised if they have a custom module or two as well.

There is a module that allows you to create facets without Solr but I have never used it. http://drupal.org/project/faceted_search

Something to remember, if your nodes have one parent-child relationship, then book could be the way to go. You can do a lot with this module http://drupal.org/project/advancedbookblocks (I use it on http://planningdrupalsites.com). BUT if you are dealing with siblings, and siblings have multiple interests, then taxonomy will probably play a role - coupled with views and/or faceted search most likely.

There are many ways to create navigation on a site. The method you choose will depend on the content and the processes/tasks you want to use to make them show accordingly. For instance, (assuming you aren't in the mood to do some custom coding) if you have a fixed number of topics but with in each topic the number of nodes is variable, you can manually create a view page for each topic, put the view page in a menu (hierarchical menu structure if the topics are hierarchical) and then each page that gets produced lists the nodes called for in that view. On my resume/blog site (http://idcminnovations.com) I use this technique. I have used it on other sites with hierarchical relationships as well. This is pretty basic but easy to do.

Of course manually building out the navigation is time consuming if you are doing it by hand but once it is done, it is done. If you have a fixed structure but the content grows inside the fixed structure, this might work.

Or can also get streamlined and get into passing term arguements to views so the results of a view appear if a node meets a specific criteria. I have done this as well. "Take the term associated with node, pass that term to the view as a filter, show the view results if the filter yields results." Kinda cool if you plan it out. I used this recently when building a gallery. Each time a gallery is added, the view block acting as a menu gets the gallery, the gallery page gets built when the images in the galleries are assigned to the gallery term.

The possibilities are endless. Try searching DO for navigation or menu or facets or whatever and then filter the search using DO's facet on the right called "projects." That will give you all projects that have that word and you can get some ideas. Don't be afraid to mix things up. BUT planning before building (or rebuilding) is the key.

Left Hand Navigation...

alotronic's picture

Yes I have dealt with this a lot. Book is fine but if you want to do anything out of the ordinary it can be a right pain.

Building navigation by hand on a smallish site is the right way to go. People coming to edit your site in the future can clearly see what's going on and reordering pages using the 'Menu' admin path is easy. The idea of 'Book' is quite weird and foreign to most users and they struggle with it.

I usually hand-build a couple of top-level menus and then, depending on the site's needs, I will fire up views (for lists of stuff) or keep building navigation. This means I get control of the first couple of clicks and then programatically fill the rest of the site.

For more complex needs I use a combination of Menu Block, Context and Menu Breadcrumbs - See here for this: http://allenoleary.co.uk/blog/?p=6
I have used this technique here: www.artsinform.com

Hope this helps...

IDCM do you have a link to

Diegen's picture

IDCM
do you have a link to the gallery you built with views and terms ?

ALOTRONIC
I kind of agree that books are something foreign to the end user, I can almost hear my client saying "but I dont want to add a book I want to add a menu item".

Can you recommend any views tutorials that will allow me to build subnavs with views, esp lists with lists embedded i.e:

|
|__ Item 1
|__ Item 2
|
|__ Item 2 A
|__ Item 2 B
|
|__ Item 3

Views gallery

idcm's picture

@Diegen, the site with the gallery has not been launched yet. The goal is end of August. But I have been meaning to write up the recipe I used to create the gallery. So ... here is a link to the tutorial/recipe - http://idcminnovations.com/article/image-gallery-tutorial-images-belong-...

That is so cool. Thanks

Diegen's picture

That is so cool. Thanks IDCM.

Can you recommend any views tutorials that will allow me to build subnavs with views, esp lists with lists embedded i.e (parent child relationships):

|
|__ Item 1
|__ Item 2
|
|__ Item 2 A
|__ Item 2 B
|
|__ Item 2 B A
|__ Item 2 B B
|
|__ Item 3