How do I get a nodes taxonomy terms to link to a view page . . . ? A pointer in the right direction would be much appreciated!
Hi all,
A couple of months into Drupal and my only regret is that I didn't get into it years ago!
Anyway, here goes with another of those small problems that I've searched and searched for the answers to, but finally have to bite the bullet and ask . . .
I'm creating a site about wine for a local wine club. The site will have some static type pages with information about various vineyards, wines, countries and wine producers. The members will be able to log in and create new 'nodes' with information about wines etc. There will be several vocabularies with terms such as 'red', 'white', 'french', 'californian', 'sweet', 'dry' etc etc
so, the idea is that the member creates new content and puts the new node into anyone of several categories (multi select) so the information can be easily retrieved later. There'll be the usual boxes on the home page with 'latest news' entries and perhaps some random stuff about the club . . .
All really very simple stuff for Drupal, not stretching it's abilities at all!!!
The club need a menu system with links pointing to pages that display a collection of nodes for each term. For instance, a menu item points to a page called www.domain.com/french, and on that page will be all the nodes tagged with 'french'
Another static menu item may point to www.domain.com/californian, and this will display all nodes tagged with 'californian'
So, I've set up views for each of the pages, with a 'header' section of reference information and images, and I use a filter to display all the relevant nodes below it. Each view using the views module is set up with a Url alias which is relevant to the information to be displayed. So far, so good, no problem at all
But here's the thing . . .
Each node can be in several categories, each of which is displayed on the node itself (we want it to be). Each one of these is a link to the actual system generated url for that category, So the link for 'red' points to something like "taxonomy/term/7"
What I'd like is for the taxonomy link shown on the node to point to www.domain.com/red, which is the view that shows those nodes the way we'd like them to be shown
I've tried to create a url alias for the taxonomy term, but because it's already allocated to the view we've set up, Drupal returns the request with an error, stating that the path already exists!
Now, if this was a case of only one term on each node, I could create a different content type and edit node-red.tpl.php etc for each one, and hard code the link in, but because each node can have several categories, this is just not possible
So, if anyone can point me in the right direction with setting up the link from the taxonomy term, I'd be very grateful
Thanks!
Biggy

..\/..
Taxonomy Redirect may do it...
I've only used it to redirect /taxonomy/$tid to a view with a TID argument, like: /view/$tid
Given that you have a different view for each term....? not sure if it'll work.
Here's a thought: instead of having a separate (basically duplicate) view for each term, just use a single view with TID or Term argument (with custom title). Then Taxonomy Redirect will do the trick nicely.
Now your problem is those "custom headers" for each term's "page" (I suspect this is the only thing different between your various views?). One way to handle this would be to create a new Node type (say "headers") with the custom heading info. Make them sticky so they are always on top. Tag them with the single tag for the view page they describe. Include this node type in your view's filter. Now /view/red will show your 'red' "header" node at the top followed by all the 'red' nodes.
good luck.
Thanks jfall!
Thanks very much, I'm gonna spend some time going over the ideas in your post
Just a couple of points . . .
Is Taxonomy Redirect a module?
Also, I think I confused matters when I referred to 'headers'! what I meant is the 'header' area created by a view when we select 'page' as the view type. I just meant the static information that we can create at the top of the page, with the node teasers displayed below it
Just trying to get my head round this . . . is there a way to create only one view, then when a user clicks on a taxonomy term the view displays with the url and contents generated automatically depending upon the taxonomy term? Is that what you meant by using a TID or Term argument?
I really do have a lot to learn, but hey . . . it's great fun trying!
Thanks again
no problem...
I was there just a couple months ago - Views is kind-of a high hill to climb, but worth the effort!
Yes. If you haven't seen http://drupalmodules.com/ go there now - use the Module Finder - its awesome.
No, I think I got you - but you only get one static header per view, so if you only have ONE view (as I suggested), you only get ONE static header, which I was assuming might be a problem for your app. I was simply suggesting an alternate way to get a static header at the top of each view page in that case.
Yes.
This is one of the most powerful features of Views - path arguments. Basically, you can pass an argument to the view via the path. So, if your View path is "views/wines", then www.example.com/views/wines/red will "pass" the argument value "red" to the view. Arguments act as an additional filter, so IF your View defined a 'Taxonomy: Term Name' argument, then only nodes tagged "red" would be displayed at that path.
Again, use Taxonomy Redirect to allow Views to "take control" of those terms so they link back to your view page instead of to the default taxonomy/term/tid path.
Here's an example from my site:
http://lasqueti.ca/marketplace/browse/listings/79
the view path is "marketplace/browse/listings" and the argument is term id (tid) 79 (accommodation). That's a basic Teaser View with a Term ID argument.
If you click on one of the teaser links, you'll see the Accommodation term listed on the page - and if you click on the term, it'll take you back to the browse/listings/79 page. That's Taxonomy Redirect, which is configured to redirect terms from that vocabulary to this marketplace view.
The Directory page http://lasqueti.ca/marketplace/directory displays the entire taxonomy hierarchy - click on any term to see the Teaser View for that term. This is ALL done with ONE view (with a Term ID argument) plus Taxonomy Redirect (just one configuration setting) plus a small snippet I developed to display the directory (which is actually just a custom "summary view", displayed when no argument is provided for the view).
Hope that helps clarify how the pieces fit together...
Go have a good read in the Views documentation http://drupal.org/node/109604 - it is a lot to wade through, but as I said, very worthwhile.
good luck