2

I am trying to build a menu with taxonomy terms and views.

Lets say that I have a tree of taxonomy terms

  1. Parent-1
    • child-1.1
      • grandchild-1.1.1
        • greatgrandchild-1.1.1.1
        • greatgrandchild-1.1.1.2
      • grandchild 1.1.2
    • child-1.2
      • grandchild 1.2.1
        • greatgrandchild-1.2.1.1
        • greatgrandchild-1.2.1.2
      • grandchild 1.2.2

I am having problems viewing only the children of the taxonomy menu. I want to exclude the current level, and only see the children, not the grandchildren of an item. So for instance.

When I am viewing child-1.1, I only want to see grandchild-1.1.1 and grandchild-1.1.2, not any of the great grand children. I don't want to see child-1.2 or the parents.

Thank you very much for your help!

1 Answer 1

2

Can you set up your Taxonomy view to accept the argument Parent term and pass it the current term? I don't know how complex your view is, but I got it to work in this basic example:

View type: Term
Add arguments: Taxonomy: Parent term
Action to take if argument is not present: Hide view / Page not found (404)
Validator: Taxonomy term
Argument type: Term ID
Add fields: Taxonomy: Term Term

That will display only the current term's children, i.e. those that have the current term as a parent.

1
  • 1
    Hi Jan, I was wondering if you could tell me were View Type, Add Arguments, and add field was? I thought you referred you contextual filter Content: Has taxonomy term ID (with depth) but I could not find them. Thank you
    – znat
    Commented Apr 21, 2012 at 21:22

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.