How to list taxonomy terms in a hierarchy (Drupal 7)

So, I have a hierarchy of taxonomy (assigned to blog posts as free tags) that looks, say, something like this (sorry, it's completely arbitrary for testing right now):

Example taxonomy terms

I would like to create a block that simply displays what I see in this menu: taxonomy terms arranged in a hierarchy, with links to the taxonomy terms page (listing all the content that this term refers to). Ideally, the number of nodes each member joins is also counted.

At first I tried to define the block and used taxonomy_get_tree , but it was a small deal trying to recursively translate the output of this function into something that I could work with. I also tried the views, introducing taxonomy terms, but I could not get them to display them as a hierarchy or get a count.

So, I'm a little puzzled. Any thoughts?

+4
source share
1 answer

You checked the taxonomy menu module - http://drupal.org/project/taxonomy_menu This module does everything you mentioned and also displays the number.

+5
source

Source: https://habr.com/ru/post/1401209/


All Articles