开发者

Drupal 7 views filter by node's taxonomy term

开发者 https://www.devze.com 2023-04-03 22:33 出处:网络
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 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...


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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消