I have a view that generates a block on all taxonomy term pages under a specific vocabulary (lets call this vocabulary 'pages' for now). That specific vocabulary has a field added that is a term reference to a a vocabulary we can call 'pagetype' (you can only select one value). I want my view to display all 'pages' that have the same 'pagetype' as the one that I am currently on. The problem is I cannot figure out how to use the current term's 'pagetype' for the contextual filter instead of the current term ID. Any help with this would be awesome.
- Create view (block)
- Add fields (title, a small image, date, whatever you like). Or teasers, what works as well.
- “Arguments” is from now on called “Contextual filters”, so go there.
- Add the filters: “Content: Has taxonomy term ID (with depth)” and “Content: Has taxonomy term ID depth modifier”
- Configuration on this filter: → When the filter value is NOT in the URL: → Provide default value → Type: Taxonomy Term ID from URL → under that, check the box “Load default filter from node page, that’s good for related taxonomy blocks.” → now check the boxes of the taxonomies you want involved here
- Now you need to add the second filter in order to exclude the current node from the list. Click [+] button of the contextual filters section.
- Select Content: Nid
- Set the ‘when argument is not present’ to ‘Provide default argument’
- Set the ‘Default argument type’ to ‘Content ID from URL’
- Go to “MORE” , and check the “Exclude” box.
- Move the filter “Content: Nid” to the top position.
- Add a block to your view and embed the block on your node pages
- Save your view
Try out Taxonomy Term Reference Filter by Views module:
Add Views Settings for a Taxonomy Term Reference Field Instance to filter the available terms for the field widget form input. inspired from Views integration of Entity reference field widgets.