I have a vocabulary set up called (for example) "Produce". And it has parent terms like "fruit" and "vegetable". Child terms are like "banana", "apple" and "cucumber", "squash".

Whenever I create a new node about fruit or vegetables, I use a content type that I created. In this content type, I have a field set up called "field_produce_and_name". So when I create a new "Fruit" page, called "papaya", I also create "papaya" as a child taxonomy term to "fruit". And I set the field field_produce_and_name to "papaya".

When someone is viewing the "papaya" page/node, I would like a sidebar menu list to display the titles of other "fruit" nodes. That is, a list of nodes that share the Parent taxonomy term as "papaya".

I have tried using the contextual filter "Content: Has taxonomy term ID (with depth)" but it still isn't working :(

I also think that maybe I need to add a relationship, but am unsure how/which one.

Any ideas?

  • Another post/question recommended using the contextual filter "Taxonomy term: Parent term", but that contextual filter isn't listed in my views. – viewsishard Feb 27 '13 at 16:18

Yes, add a relationship for the taxonomy field and the parent contextual filter will be available.

  • Thanks! When choosing the right relationship, do I choose "Content: Taxonomy terms on node" OR "Content: Produce and Name (field_produce_and_name)"? Those are the only two relationship choices that mention taxonomy. – viewsishard Feb 27 '13 at 18:17

I've done this with a content type that has a term reference field to associate a taxonomy term with a node. You can do this by adding two relationships.

  • Taxonomy term: Parent term
  • Taxonomy term: Content using

You can then add a new Taxonomy term field into your view and select Parent as the relationship for that field. You can also then group by this parent field.

Please feel free to ask questions if this isn't quite clear enough and I'll try and explain further.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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