Implement Page with Draggable Hierarchy Tree

Created on 3 September 2025, 11 days ago

Problem/Motivation

As a user, I want a dedicated page where I can view and manage a hierarchical data structure in a tree-like table, so that I can easily visualize, organize, and modify the relationships between elements.

Key Features & Requirements:

  • New Page Creation:
    • Create a new, dedicated page to host the hierarchy management table.
  • Multi-Tree Support & Configuration:
    • The system must support separate hierarchy trees for different entity types and bundles.
    • A menu or selector UI should be implemented, allowing users to choose which entity/bundle tree they want to view and manage.
  • Hierarchical View:
    • Display elements in a table or list format that clearly shows the parent-child relationships (a tree structure).
    • Child elements should be nested under their parent.
  • Drag-and-Drop Functionality:
    • Implement drag-and-drop capabilities for all elements in the table.
    • Users should be able to reorder elements at the same level.
    • Users should be able to move an element to become a child of another element (re-parenting).
  • Element Creation:
    • Provide a mechanism to create new elements.

Acceptance Criteria:

  • A new page exists that displays the data in a hierarchical tree.
  • A menu is available to select and switch between trees for different entity types/bundles.
  • The page correctly displays the hierarchy only for entities with a configured hierarchy reference.
  • The correct tree is built based on the entity type and its target bundle.
  • I can successfully drag and drop an element to change its order among its siblings.
  • I can successfully drag an element and drop it onto another element, making it a new child.
  • There is a clearly visible button/control to "Create New Root Element" that functions correctly.
  • Each element in the tree has an option (e.g., a "+" button) to add a child element, and it works as expected.
  • All changes to the hierarchy (reordering, reparenting, creation) are saved.

Technical Notes

For the draggable table implementation, utilize the built-in tabledrag functionality available through the Drupal Form API to ensure consistency with the core UI and maximize stability.

✨ Feature request
Status

Active

Version

5.0

Component

Code (module)

Created by

πŸ‡ΊπŸ‡¦Ukraine r_cheh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024