2

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?

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

2 Answers 2

0

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

1
  • 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. Feb 27, 2013 at 18:17
0

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 agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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