Flattening Content in the Book Module

Deep menu trees are not fun to navigate and make for an awkward user interface. We recently faced the challenge of how to simplify the book module's navigation so users wouldn't have to dig down through many levels of navigation.

For McGill's Course Calendar website, we created the Flat Book module, which simplifies the book menu by collapsing pages deeper than the second level into a single page. Instead of showing the hierarchy in the menu, all the content deeper than the second level is displayed below its parent.

This can sometimes create rather long pages. So we added a Wikipedia-style table of contents to the flattened pages. Users see a table of contents at the top of the page and can jump down to view the subpage they're looking for. Subpages have smaller headings than their parent page, so users can see the content's hierarchy at a glance.

You can see the Flat Book module at work in the regulations section of McGill's Course Calendar website.

If you're interested in taking a closer look at the module, you can see the code on Git Hub . I've also submitted the module to drupal.org: http://drupal.org/node/770204. Any feedback there would be most appreciated!

Comments

Very cool! We run courses and develop them via books a lot of the time so I might have to look into implementing this. Have you looked at outline designer for simplifying book creation? Makes it easier / faster to build those icky book outlines in the first place: http://drupal.org/project/outline_designer

You could also use a "table of contents" style of approach. It might not be necessary to split every "chapter" into a node.

I've written an article about this at http://www.drupalcoder.com/story/699-automatically-create-table-of-conte...

@Davy Van Den Bremt

Thanks for the link! Table of Contents definitely looks like a good approach to create Wikipedia-style pages.

For this particular project, we needed to use the book module because we were importing the content from a Documentum database and needed to be able to track revisions to the content ordering on a per-book basis. We also needed to keep the individual nodes within the book separate so they could be updated by our import script.