Book module overview

Last updated on
30 August 2023

This documentation needs review. See "Help improve this page" in the sidebar.

A book is a set of nodes tied together in a hierarchical structure, with chapters, sections, and subsections. You can use books for manuals, site resource guides, Frequently Asked Questions (FAQ), novel, or curricula. Any content type can be added to a book, and a book can contain nodes of more than one content type.

The Book module is a core module which is not installed by default. It must be installed from the Manage >> Extend page.

Users who have the right permission can create a book and write, review, modify, or rearrange the nodes that are part of a book. Many users can work together on a book; you can allow or disallow collaboration, to whatever extent you want. You can't manage different rights for different books by default. The standard Drupal installation allows you only to define permissions for the content type, not for nodes nor node trees.

Configuring books

On Structure >> Books, click on the Settings tab to set:

  • which content types can be used to add nodes to books
  • the content type of the nodes added by clicking on the Add child page

You can enable one or more content types to be used for book's nodes. All books have the same set of enabled content types.
On Manage >> People >> Permissions, scrolling down to the Book section, you can control who can create, edit, and maintain book nodes.

Creating and modifying books

Users who have the permission to add nodes to books will have access to an Outline tab; when a node that can be added to a book is edited, an Outline section will appear. Both can be used to put a node into a book.

Creating a book

To create a book, edit a node that can be added to books. Add the node to a new book:

  1. On the page, click Edit
  2. On the edit form, open the Book Outline section
  3. Set the Book drop-down to Create a new book
  4. Save the node

Drupal creates a new book with the name of the node you added.  

Adding a node to a book

Use the same system to add a node to an existing book, using either the Outline tab or the Outline section of the node edit form.

To add the node as a sub-page of any existing node, set the Parent Item value to the node where the new node should appear in the book hierarchy. 

Modifying the order of pages in books

When adding or editing a node that is in a book, you can change the parent Item and change the weight, which controls the order of the nodes under the parent. Nodes with lower weight appear before nodes with higher weight. (For example, 1 appears before 2 and -1 appears before 0.)

Alternatively, reorder nodes on the book listing. Choose Structure >> Books to see a list of the existing books. Click on the Edit Order And Titles button for the book you want to edit, drag the nodes into the structure and order them, click on Save Book Pages to save the changes.

Book navigation and menus

When users visit the site and view a book node, they see links at the bottom for navigating from the parent node to the first child node, and from the previous node to the next node. A link labeled Up leads back to the parent node in the book structure. A link to a printer-friendly version of the node is shown at the bottom, for users with the permission to view a printer-friendly version.

The Book module automatically generates a contents page for each book. However, if the books on your site are complex, you may need additional navigational aids beyond the table of contents and the previous/next/uplinks for users to understand where they are in your book. One navigational aid you can use is the book navigation block, which you could enable from the Block Layout page. Enabling this block turns on a menu that shows when users are viewing a book.
If this block is not available after installing or activating the module, you should refresh the site cache. Check also for translation of the blocks name, if your language is different from English.

To extend this menu to show its children and grandchildren, look into the Book Tree Menu, but which is not covered by the security advisory policy and which requires at least a Bootstrap theme (which one is not clear). Use at your own risk! It may have publicly disclosed vulnerabilities. The Custom Book Block module was created as an alternative that does not require Bootstrap, and has opted into security coverage for stable releases.

When you reorder book nodes, the new order will be reflected immediately in the Book navigation block (8.4.1-dev). However, you have to clear the cache before the new order will be reflected in the content area.

Help improve this page

Page status: Needs review

You can: