1
votes

I have content type that have one taxonomy filed. I like to create block to display in that content page that gathered the title of other content type that have same taxonomy term. Any idea for creating relations or contextual filters?

1

1 Answers

1
votes

I would do like this for the contextual filter:

1) Create a "Has taxonomy term ID" contextual filter

2) WHEN THE FILTER VALUE IS NOT AVAILABLE -> Provide default value -> Taxonomy term ID from URL Check "Load default filter from node page, that's good for related taxonomy blocks" : this is the main trick. It will load all taxonomies from the current node. Configure "limit terms by vocabulary" and/or "Multiple-value handling" if needed

3) WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED -> Specify validation criteria -> Taxonomy term -> and check the taxonomy you're looking Filter value type should be set to "Term ID"

Then play with static filters as usual if needed.

ps: If your content type has a multiple taxonomy field (for example checkboxes) you have to enable "Allow multiple values" under the "MORE" section of the contextual filter and set accordingly the "Multiple-value handling" at step 2.