Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Entity Reference (with) Hierarchy

Security covered Under active development 126 sites

Part of the Entity ecosystem · 308 projects

This module allows you to create deeply nested, hierarchical structures within a single entity reference field. It provides a drag-and-drop interface for managing the hierarchy and integrates with revisions and other modules for advanced content modeling.

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.

Drupal 9–11

Ask your assistant about Entity Reference (with) Hierarchy

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
3
Tracked since
Dec 2023
Latest release
5 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.1 Stable 9–11 Apr 20, 2026
1.0.0 Stable 9–11 Jan 25, 2026
1.0.0-beta4 Pre-release 9–10 Dec 20, 2023