Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal 7 views filter by node's taxonomy term

I have a similar question to my previous one (Drupal 7 views filter by dynamic taxonomy term), it's only the other way round.

I have a "partner" content type, each with it's own taxonomy term. The other content type is a regular page with multiple terms from the "partner" vocabulary. In my regular nodes, I want to include a few of the "partners" in a view block.

The view should filter only those relevant partner nodes (those tagged with one of the regular node's tags).

Could it be done this way? The problem is that I can't get the term names from URL via contextual filters...

like image 589
mreq Avatar asked Sep 11 '11 20:09

mreq


1 Answers

After googling the whole afternoon (and posting it there), I eventually found the answer.

It's based on a tutorial on scito.ch (thanks), with only a few modifications. On the Content: Has taxonomy term ID (with depth) filter, be sure to check the Allow multiple values checkbox. Also (there's a lot of wrong tuts for that), don't specify anything in the WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED. It's important you specify all those 3 contextual filters.

Hope this helps someone and saves him a sunny afternoon :)

like image 93
mreq Avatar answered Nov 19 '22 00:11

mreq