entity_reference_hierarchy
Entity reference field that comes with Drupal core allows creating a linear list of entity references. This module allows creating hierarchical entity references where each entity reference is in a parent/child relationship with another entity reference. It also supports revisions if used together with Entity reference revisions module.
Example:
- Reference (delta 0)(depth 0)
- Reference (1)(1)
- Reference (2)(1)
- Reference (3)(0)
- Reference (4)(1)
- Reference (5)(2)
- Reference (6)(1)
- Reference (7)(0)
Entity reference items can be dragged and dropped with the same UI that handles taxonomy menu links hierarchy.
Notes
I initially set out to create a more generic version of Bricks that doesn't include styling. After building most of the module I then found https://github.com/maijs/entity_reference_hierarchy and was able to make some improvements.
Comparison to Entity Reference Hierarchy
Entity Reference Hierarchy creates a tree through a chain of Entity Reference fields on each entity type. A nested set.
Entity Reference (with) Hierarchy uses a single field on the primary entity to manage the tree structure. A rooted tree. This works very well for paragraphs.