1

I have a vocabulary Area for classifying maths problems, with two parent terms (Pure and Applied) and appropriate child terms (Geometry, etc.) under each. Problems (a content type) are tagged with the appropriate areas of mathematics that they cover.

I also have a table page defined in Views with filter criteria Type (= Problem) and Area (exposed), for listing all the problems.

The problem I have is as follows: If someone selects `Applied Mathematics', nothing appears, because Problems are only tagged with the child terms.

How can I get all the Problems to show up?

In Drupal 7 I should add!

1
  • Tell us your view settings. Which filters and contextual filters? Is it a page or block?
    – Ashlar
    Commented Jan 31, 2012 at 23:19

1 Answer 1

2

If you look at the default Taxonomy Term view provided with views, you'll see that it has a contextual filters Content: Has taxonomy term ID (with depth) and Content: Has taxonomy term ID depth modifier. Both are needed. If you look at the description for the Depth field for the first filter you'll see the following:

The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).

In your case fruit is applied and apple is, for example, Geometry. So if you specify a depth of 1 or higher you should get the behaviour you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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