Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Views Tree allows for the rendering of hierarchical relationships between entities or users as displayed in a View. The module simply adds a display format for Views titled 'Views Tree (adjacency model)'.
Views Tree with Taxonomy Terms
Creating Taxonomy Terms
Create some Taxonomy terms with parent/child (heirarchical) relationships.
Creating the View
First, create a new term view using the fields row style / unformatted list of fields (it is important that the tree style not be chosen now). Then:
Add relationship for taxonomy term: parent term
Add field term id (do not use relationship) and exclude it from display
Add field term id with relationship, exclude from display
Add any fields you want to display, like term name, term description, etc...
Change style / format plugin to Tree (Adjacency model)
Set Main field to Term ID
Set Parent field to Term ID with parent relationship