0

I`m having a view block displayed on node page. In this block i want to show only other nodes that have the same child taxonomy selected.

I tried with contextual Content: Has taxonomy term ID (with depth)

and those settings and is not working https://www.screencast.com/t/b8GJftJSanwA

The taxonomy looks like this

parent term1
- term1
- term2

parent term2
- term3
- term4

And on node are selects both parent and child.

Any ideas?

  • Are term2 and parent term2 the same? In effect making this 3 level Taxonomy? I guess you'd have it structured differently then. – prkos Jun 5 '18 at 22:55
0

There are two parts to your question, showing only nodes that have child terms, and getting the Contextual filter to work.

List only nodes that have child terms

This part of the question can be solved by using a regular Filter Has taxonomy term and then select only the 2nd level from the list with the Operator set to is one of.

The same applies if you add a filter Content: YourTaxonomyField instead of the Has taxonomy term.

Contextual taxonomy filter

With the main filter taking care of the depth, you don't need the Depth one as the Contextual filter.

Add Content: Has taxonomy term ID as the Contextual filter. Your example didn't have it set up correctly. It should be:
When the filter value is NOT available
Provide default value
Taxonomy term ID from URL
Only tick Load default filter from node page, that's good for related taxonomy blocks
Filter to items that share any term
Under More
Allow multiple values if your nodes can be tagged with more than one term at a time.

Don't forget to place your Block and adjust Block settings for the Contextual filter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.