Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

The Entity Reference (with) Hierarchy module extends Drupal core's standard entity reference field, transforming it from a flat, linear list into a powerful rooted tree structure.

While Drupal core only supports simple lists of references, this module allows you to define complex hierarchies directly within a single field on the host entity.

Architecture: The Rooted Tree Approach

Unlike other hierarchy solutions that create "nested sets" by chaining reference fields across multiple individual entities, this module manages the entire hierarchy map via a single field. This rooted tree architecture stores depth and weight metadata alongside the target ID on the primary entity.

This approach is exceptionally well-suited for Paragraphs, where you may need to manage deeply nested layouts and components without the overhead of cross-entity field chaining.

Key Features

  • Visual Hierarchy Management: Includes a drag-and-drop interface identical to the familiar UI used for managing taxonomy terms or menu links in Drupal core.
  • Single-Field Data Model: The entire tree is stored and managed on the root host entity.
  • Revision Support: Fully compatible with Entity Reference Revisions, allowing for historical tracking and revisioning of the entire hierarchical structure.
  • Ecosystem Ready: Works seamlessly with Inline Entity Form and Paragraphs for advanced content modeling.

Example Structure

The module tracks both delta (weight) and depth to maintain the tree:

  • Reference A (delta 0, depth 0)
    • Reference B (delta 1, depth 1)
    • Reference C (delta 2, depth 1)
      • Reference D (delta 5, depth 2)
  • Reference E (delta 3, depth 0)

Comparison to Entity Hierarchy

It is important to distinguish this module from Entity Hierarchy:

  • Entity Hierarchy creates trees through a chain of reference fields pointing to one another (a nested set model).
  • Entity Reference (with) Hierarchy uses a single field on the primary entity to manage the structure (a rooted tree).

Background & Credits

This project was born from a desire to create a more generic, unstyled version of Bricks. During development, it incorporated improvements and logic inspired by the entity_reference_hierarchy repository by maijs.

Activity

Total releases
2
First release
Jan 2026
Latest release
1 month ago
Release cadence
85 days
Stability
100% stable

Releases

Version Type Release date
1.0.1 Stable Apr 20, 2026
1.0.0 Stable Jan 25, 2026