Validate this page Made on a Mac Powered by HostPapa 100% Green Energy
Powered by Drupal, an open source content management system
green web design independent web design drupal content management system dynamic websites

Interesting Navigation Challenge

The Request:
I was recently asked to convert a static site onto a Drupal platform and was presented with an interesting navigational challenge.

The navigation is layed out like a grid like this:

          Top1 Top2 Top3 Top4 Top5
Left1

Left2

Left3

...etc

Each has a landing page. So, if I click on Top4, I come to its page. The tricky part comes when I then click on Left1. I don't come to the landing page for Left1, I come to a page that deals with a cross-reference of Top4/Left1.

One Solution:

This solution depends on Views and arguments (thanks Merlin) as well as URL Alias. There may be a different (better?) solution, but I like the simplicity of passing an argument.

  1. I created two taxonomy vocabularies. "Top" and "Left", respectively. (*It's not actually necessary to create this menu using taxonomy unless it's important for your client to have the option of adding a link later).


  2. I enabled URL Alias. Each path follows the same convention - top/left. I used top/overview and all/left for pages that deal only with one term.


  3. I used Views to create two Term Views - one for "Top" and one for "Left". I added a Block for each.


  4. In the View Fields, I listed the taxonomy terms (and filtered them by Taxonomy Vocab).


  5. I set up an argument for Taxonomy Term. Action to take if argument is not present: Display all values.


  6. **This is the key** - Validator options. I selected Taxonomy Term and selected the other vocabulary. Argument type, Term ID.

  7. Back in my Fields, I checked "Output this field as a link. I created a path using [name]/!1 - in other words, using the term and the argument. This matches the url aliases I created for each taxonomy term.


  8. Voila! Neat trick.