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.
- 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).
- 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.
- I used Views to create two Term Views - one for "Top" and one for "Left". I added a Block for each.
- In the View Fields, I listed the taxonomy terms (and filtered them by Taxonomy Vocab).
- I set up an argument for Taxonomy Term. Action to take if argument is not present: Display all values.
**This is the key** - Validator options. I selected Taxonomy Term and selected the other vocabulary. Argument type, Term ID.
- 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.
Voila! Neat trick.