Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Cms 2.1.4 Update released for Drupal core (2.1.4)! Release: Facets 3.0.6 Minor update available for module facets (3.0.6). Release: Facets 3.0.5 Minor update available for module facets (3.0.5). Release: Pantheon Advanced Page Cache 2.4.1 Minor update available for module pantheon_advanced_page_cache (2.4.1). Release: Flag 5.1.0 Minor update available for module flag (5.1.0). Release: Workbench Email 3.0.8 Minor update available for module workbench_email (3.0.8). Release: Drupal CMS Helper 2.1.4 Minor update available for module drupal_cms_helper (2.1.4). Release: Analyze AI Content Security Audit 1.3.1 Minor update available for module analyze_ai_content_security_audit (1.3.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Module Revived: ЮKassa (YooMoney) для Drupal v7 2.6.1 Module yoomoney_api updated after 7 months of inactivity (2.6.1).

Taxonomy Term Reference Tree Widget

12,484 sites Security covered Drupal 9–11
View on drupal.org

Term Reference Tree provides an expandable tree widget for taxonomy term references, offering a more user-friendly alternative to Drupal's default flat lists for managing medium to large taxonomy structures. It includes features like collapsible branches, theme customization, and optional filtering via Views. Additionally, it offers a display formatter to show terms hierarchically and supports client-side selection limits.

About this module

This module provides an expandable tree widget for the Taxonomy Term Reference field in Drupal. This widget is intended to serve as a replacement for Drupal's core Taxonomy Term Reference widget, which is a flat list of radio buttons or checkboxes and not necessarily fit for medium to large taxonomy trees.

This widget has the following features:

  • Expand/minimize buttons
  • Fully theme-able
  • Filter and sort available options with a view (if views is installed)
  • The ability to start with the tree either minimized or maximized
  • If you limit the number of selectable options, client-side javascript limits the number of terms that can be selected by disabling the other remaining options when the limit has been reached (this is enforced on the server side too).
  • For large trees, this widget now optionally keeps a list of selected items below the tree.
  • You can use tokens to alter the widget label (good for adding icons, turning the options into links, etc).

This module now comes with a display formatter with the following features:

  • Display taxonomy terms as a nested list by hierarchy.
  • Displayed terms can be altered with tokens or themed using a custom theme function.

Future features include:

  • Dynamic loading of the tree as it is expanded (for very large trees)

    Note: I don't have time to implement this at the moment. If someone is willing to volunteer to do this, I'd appreciate it.

How to use this module

  1. Enable the Term Reference Tree module.
  2. Go to the Manage Fields tab of any fieldable entity (such as a content type, taxonomy term, or user.
  3. Add a new field with a type of Term Reference.
  4. In the widget select box, select Term reference tree.

Note that you can also change any Term Reference field to use the Term Reference Tree widget, by editing that field and selecting Term Reference Tree on that field's Widget Type tab.

If you want to filter by a view, make sure the view includes the taxonomy term ID, and that the items per page is set to unlimited, as the widget will only display the items from the first page of results.

This module is also perfectly good for flat lists, particularly if you want to filter them by a view or limit the number of selectable options with JavaScript. I recommend turning on the "leaves only" option in this case, as it will make it look nicer.

Depends on

Dependencies of the latest stable release

  • taxonomy Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jan 2025
Latest release
2 months ago
Releases (12 mo)
1
Maintenance
Active

Releases

Version Type Core Release date
2.0.3 Stable 9–11 Jun 3, 2026
2.0.2 Stable 9–11 Jan 5, 2025