Reading view

Struggling to render hierarchical Entity Reference lists in Views

Hi everyone

I’m trying to set up the Entity Reference Hierarchy module, and I’m stuck on the Views integration part.

The module description says:

Render a list of children at any depth using views

That sounds exactly like what I need, but I can’t figure out how to make it work.

Here’s what I’ve done so far:

  • Added an Entity Reference field to the Basic Page content type.
  • Populated that field to create parent/child relationships between pages.
  • Created a custom table View to list the pages, which works fine, but it just lists them flat.

What I can’t seem to achieve is displaying them in a hierarchical structure, like a nested tree, or at least grouped by parent, ideally with pagination or depth control.

I’ve tried playing around with contextual filters, but no luck so far.

Has anyone managed to get this working?

Ultimately, I’m looking for a table View of pages that visually shows the parent-child relationships, similar to how WordPress displays its page hierarchy (even something simple like using dashes to indicate depth, e.g. “-- Service 1,” would be perfect).

UPDATE:

This comment from u/Optl13 made my day, it worked perfectly.

submitted by /u/Admirable_Reality281
[link] [comments]
  •  

Is there a way to view pages hierarchically in Drupal instead of a flat list?

Hey everyone,

I’m new to Drupal and I'm trying to figure things out. Is there a way to view pages (or any content type with parent/child relationships) in a hierarchical or tree-style view instead of just a flat table?

Something like:

  • Home
  • About
  • Services
    • Service 1
    • Service 2
    • Service 3
    • Service 4

Basically, I’d like to visualize the parent/child structure more clearly when managing content. Even something simple, like WordPress does with a few dashes to indicate depth, would be totally fine.

Thanks in advance

submitted by /u/Admirable_Reality281
[link] [comments]
  •  
❌