Add flexible display options for book pages

Created on 4 February 2011, over 13 years ago
Updated 20 June 2023, 12 months ago

You know how those cliche summer teen movies always start with the nerdy girl that no one notices, and the first half of the movie is all about the work she does and how she gets ignored by the cool kids? And then she takes off her glasses, and bam! Everyone notices that she's been gorgeous all the time?

That's book module.

Let's take off its glasses.

This patch adds two columns to each book record -- 'children' and 'navigation' and enables the following new display options for each page that's part of a book:

Child page display options

  1. No display (in which the book outline is only used to generate sidebar blocks and breadcrumbs
  2. List of titles (the default display for book.module)
  3. Teasers (outputs teasers for the current book page's children using node_view_multiple(), just like the default front page

Navigation display options

  1. None (don't show any sibling/parent links)
  2. Previous/Next/Parent links (the default navigation style for books)

With these two options, book module can be used to build relatively simple dynamic listing pages using nothing but core. For small sites, this can make simple staff directories, product listings, and nicely-formatted topical index pages much much easier to build. It's an incomplete concept -- the idea would require ironing out how to set defaults for children based on the parent's display options, for example. It would make a lot more sense to use the entity field management screen to control this stuff, but book module is a very awkward fit for FieldAPI, as it applies across bundles arbitrarily. Further refinements are definitely needed. In addition, the children of a book should probably be separated out into a dedicated chunk of content, just like comments are right now, but the fact that we use hide() and render() tricks in node.tpl.php to order things makes that very difficult.

But! It's an interesting first stab at adding some very useful functionality to Book module, making it more useful as a general site building tool. Anyone think it's a direction worth pursuing?

✨ Feature request
Status

Closed: duplicate

Version

9.5

Component
BookΒ  β†’

Last updated about 3 hours ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡ΊπŸ‡ΈUnited States eaton

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024