A Site Hierarchy for Drupal

Update: This approach does not work in Drupal 6.x. The most promising solution is the Menu Breadcrumb module, but it is not quite there yet. In the meantime I've come up with a workaround.

This website hosts a number of projects, several of which have associated documentation and forums, forming a structure like this:

  • Home
    • Flat Four
      • Documentation
      • Forums
    • Premake
      • Documentation
      • Forums

I want my site navigation--meaning the navigation breadcrumb primarily, I don't worry to much about the URL--to reflect this structure.

Setting Up

For each project I create a page to act as "home". This is where I put general information about the project and links to the other pages. Then I create a book to hold the documentation, and a forum container. By default, Drupal treats each of these structures as independent. When I visit the project page, the breadcrumb is:

Home » Premake

When I visit the documentation book, it is:

Home » Documentation

There is no link back to the main project page; when a reader wanders off into the documentation they have no way to get back to the project. What I really want the breadcrumb to look like is this:

Home » Premake » Documentation

Which requires...

The Menu Module

Drupal gets the site hierarchy information from the Menu module. That feels a little weird to me, but I suppose your site menu usually does reflect the structure of the website. So I created a new menu called "Site Structure". The top level of the menu points to each of my projects, with the project-specific items like the book and forum under each of those.


The finished menu for a project.

This approach, though a bit clumsy and manual, works for all kinds of content. Create menu items for any URL and stack them up any way you like.

Filed under: Drupal

I am Jason Perkins (starkos), the founder of Industrious One. I'm yammering on about life as an indie, getting things done, Saabs, roadtrips, finding inspiration, and creating the big audacious stuff.

projects:

categories: