How to pass taxonomy terms from node into Views Filter?
I'm sure this is something that lots of people run up against, but I'm having a hard time figuring it out.
I have a large collection of nodes of a particular content type. For the sake of keeping things simple, let's say they are articles.
I'm using Taxonomy to assign categories to the articles. I have some articles assigned to category guns, and others to category butter. So far, so good.
I have two issues now.
I've made a View that shows up on each article node that displays a list of the latest articles. But what I want is if the article that is being read is about butter, then I want it to filter the View down to only those other articles with Taxonomy butter assigned to them. If the article is about guns, then it should filter down to guns.
I tried adding a Relationship to join "Content: Taxonomy terms on node". Then I added a contextual filter on "Taxonomy term: Term ID". This does not appear to have any effect.
I believe the problem is that it is looking in the URL for the taxonomy term, and since it isn't in the URL, it's just showing the default list. I've heard about people using Panels to do this, but that seems like a kludgy solution. Anyone know how to pass the taxonomy term from a node into a view filter? Do I HAVE to use Panels?
The other question is somewhat related. When assigning taxonomy terms, there are some articles which would belong in both guns AND butter. However, the list type that I have selected for the field in my node, "Check boxes/radio buttons" shows up only as radio buttons (ergo, I can't select multiple categories). Does anyone know how I can change that over to checkboxes to allow me to associate the node to more than one term?
I managed to figure out the easy part. The taxonomy selector automatically changes to checkboxes when you set the "Number of Values" in the field management screen to "Unlimited" (or something other than 1).
Ok, the reason I had trouble figuring this out is because it is very, very well hidden. But I did manage to find the solution. Here's what you have to do:
- Add a Relationship on your View: "Content: Taxonomy terms on node"
- Add a Contextual Filter: "Taxonomy Term: Term ID" - I think this is exposed because of the "relationship" in step 1.
(Now comes the hard part)
When you configure the Contextual Filter, you have to do the following:
- Check the "Provide default value" radio button
- On the Type drop-down, select Taxonomy term ID from URL (normally, this wouldn't work since we aren't passing the value through the URL, but following is the work-around)
- Check "Load default filter from node page"
- Check "Limit terms by vocabulary"
- Check the vocabularies you want to link to from the node (there should be a list of your vocabularies with checkboxes next to them).
I have a content type (News) that references another content type (Issues). I would like to display "related news" on the Issue page/node with only those News nodes that are tagged with the Issue node that I'm on. I followed the steps above and no content appeared in my view.
I think my situation is a little different in that I'm not trying to display "related news" on another News page. To use your example, I want the articles tagged with "butter" to appear on the butter page.
Any thoughts on how to get this working? (We're in D7, by the way.) Thanks!

Also, just to be clear, I can't very well put the taxonomy terms in the URL because as I suggested many articles will have more than one taxonomy term associated with them (once I figure out how to do that).