0

I have a block view that only displays the taxonomy terms in a vocabulary. However I would like to have a link generated in that block with an "ALL" option. So I created a new taxonomy entry, which is the parent of all other terms.

However if I go to the taxonomy parent, the children aren't shown, only if the nodes are set to the parent value explicitly.

For example:

All (tid=1)
-Shirts (tid=2)
--Small (tid=3)
--Big (tid=4)
-Shoes (tid=5)

So if I were to go to http://mysite.com/taxonomy/term/1 I want it to show all nodes in terms 2 and 5 (would be ideally to have 3 and 4 show up also, but not mandatory).

I am using Drupal 7.x

  • I don't think you can accomplish this without views. – magtak Nov 1 '12 at 15:20
  • 1
    with Views module you can do that easy, with contextual filter, Content: Has taxonomy term ID (with depth) and set your depth – Petro Popelyshko Nov 1 '12 at 16:13
2

Have you tried using taxonomy_get_children()?

Finds all children of a term ID.

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.