3

I've been building a Drupal 8 site over the past month that should have a stupid simple page hierarchy similar to this:

Parent Page
--Child Page
--Child Page
----Grandchild Page
----Grandchild Page
----Grandchild Page
Parent Page
--Child Page
----Grandchild Page
------Great Grandchild Page
--Child Page

I really would have thought this kind of normal Parent-child page structure hierarchy would be built into Drupal and be reflected appropriately in the breadcrumbs, but apparently it isn't, with Drupal defaulting to an absurdly flat model where every page is assumed to be a direct child of the home page (e.g., "home > event1" instead of the more categorically and structurally descriptive "home > events > event1"). In this respect breadcrumbs are maddeningly useless from a usability perspective, offering users literally no sense whatsoever as to where structurally in the site a given page is.

I've found a hierarchy that reflects properly in the menu, breadcrumbs and pathnames CAN be achieved in an automated fashion somewhat, if I simply add absolutely every single page created as a link or sublink in the main navigation menu structure. However! In some cases I have 70+ pages that are children of a parent page, so making every page part of the main menu is out of the question: in some cases I would want to display the parent page, and have the parent page act as a listing of the children pages.

I've also heard of using a Taxonomy, but I can't find any useful and sufficiently descriptive literature explaining how exactly to implement, or to accurately reflect the taxonomical properties in accurate breadcrumbs or url aliases. I would be sore indeed if I'd have to manually configure and maintain the breadcrumbs and url alias paths and their relationships for each of the hundreds of pages on the planned site.

I've also heard of using the "Books" module. Though what I'm developing may be structured similarly, I'm simply not making a book, with multiple interconnected navigable pages with chapters, sections and subsections. It seems to me beyond the pale to twist a module with functionality intended for a completely different purpose only similar to my needs as a janky ad-hoc fix.

There is a module called "Node Hiearchy" that ostensibly achieves the basic functionality I'm looking for... but to my chagrin the module isn't updated for Drupal 8 yet (a painful dawning realization about the state of useful Drupal 8 module availability as I continue learning/developing).

In short: Is there a way to implement the kind of stupid basic hierarchy I'm looking for in Drupal 8 with working breadcrumbs and url aliases? Or will I have to retrofit all of the past 2 months worth of work by downgrading everything to Drupal 7 just to get access to the Node Hierarchy module?

user1930581
  • 1,465
  • 1
  • 13
  • 23

1 Answers1

2

For Drupal 8 one possibility is Entity Hierarchy

You can apply a page hierarchy, but only one level deep. So in your example you'll be able to list "Events" on "Home", and you'll be able to list "Event-1, 2..etc. on "Events". But you will not be able to display "Event-1..etc" on Home.

Don't forget to grant the Anonymous role "Entity Hierarchy Views: Access embedded child view".

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Jag
  • 21
  • 2