10

I need to generate a menu for parent taxonomy terms.

How would I go about doing this? I'm also looking to generate these terms in a block.

I have a views set up right now that displays just all taxonomy terms. I can't figure out how to filter out child terms. Is there a filter for this, or do I just have to manually create each category item?

17

In Drupal 7 to only show parent terms you add a “Contextual Filter” and add “Taxonomy term: Parent term,” then set “Provide default value” to a “fixed value” of 0.

That will filter out the child terms.

7

You can just add a normal filter, set the "Parent term" filter to "0", that does the same as the contextual filter with "provide default value" as mentioned above. Turns out the root terms have a parent of 0 which I only just found out thanks to this post :)

  • Both have the same outcome, this is much quicker. – Paul Jan 28 '15 at 16:07

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.