Hello everyone! Drupal module development offers us a lot of opportunities, and today I would like to tell you about a standard, out-of-the-box Drupal 7 module. I have repeatedly deployed a website based on Drupal 7, but never paid attention to Drupal Book module. What are its features? What does it do?
As we understand from Drupal 7 Book module name, it enables us to create collections of materials (books). We can create various kinds of instructions, frequently asked questions (FAQ), descriptions of modules, selected materials of users, etc. By default, Drupal Book module is disabled. To turn it on, you should follow the link - admin> content> book> settings
Use of Drupal Book module
- Managing books. For books, you can separately assign permissions for creating, editing and deleting pages, creating documents in books or creating new books. Users with the permission to manage book content can add various types of documents to books. They can also view the list of all books, edit and reorder pages.
- Book menu. Apart from the additional elements which appear in the document that is part of the book, the module generates a block with specific references that can be configured in the block management section.
- Shared work. Books can be edited by different users because they allow users with the appropriate rights to create new pages in the book and include any website pages in the content of the book.
- Printing. Users with the permission to view the printer version will see links to this version on the book pages.
Book in comparison with taxonomy (classification)
Classification is created by the website administrators. The authors of articles are able to select the desired category in the classification. But often they make the wrong choice or classification does not include rarely used options.
A “book” of ready articles is a way for the administrators to combine materials on one subject, created by different authors. Both taxonomy and the book classify the material. But while in taxonomy authors select the category themselves, the book is created by the administrators in accordance with their needs.
Also in taxonomy, a separate flow of information is created for each category element. From time to time, articles appear there, the quality of which may be quite different - from good to absolutely amateurish, or the article can be completely irrelevant. And the book selects only the best articles.
Therefore, a book is always more compact than taxonomy, and its quality is always higher. We can say that taxonomy divides the information flow into dynamic flows on different subjects. A book carefully selects the best and the most relevant of all materials, collecting them in a format that is easy to view.
A book is created with shared work of many authors. The Drupal Book module perfectly implements the idea of shared work and allows to include pages created by many authors. I could call them public pages. While in ordinary articles and commentaries the authorship is strictly supported, and only editors and administrators can edit the text, in public pages the number of editors runs up to the number of users who have the right to edit a public page. Even guests can be included there. The last author who made changes is displayed as a participant of the public page.
The history of versions is tracked. Users with appropriate permissions can use the version control system to switch between them. For more convenient display of these versions, you can use the Diff module.
Examples of Drupal Book module use
- The documentation on drupal.org is written using this module https://www.drupal.org/documentation/modules/
- On the main page of the book, you can see the following links: "the previous page name”, "level up", "the next page name" (this is characteristic of Drupal Book module use)
- A striking example of this module use is a site completely built on this module. Many of you have used it without knowing this http://githowto.com/.
Recommendations on Drupal Book module use
- Since the first days of website life, you can take the opportunity to use other people’s books to create at least FAQ. Books can be made even on sites with a couple of dozens of articles.
- When you sharpen your skills in creating books and get a community on your website, proceed to public pages. For a start, make a book with several pages of instructions that reflect the website theme. Explain to visitors who have the permission to edit pages that they are expected to help in editing.
- Only when the community on the website becomes very big and the capabilities of the book are no longer enough, you can start thinking of (but not yet install) wiki modules. It’s not worth considering wiki before the amount of your daily visitors reaches 5-10 thousand a day. The Book module functionality completely covers the needs of such a community.
For example, Drupal.org has over 22.4 million unique visitors a month. Such things as FAQ and documentation of modules are implemented through books. But for some reason wiki modules are not installed on Drupal.org, although the might of the Drupal development community would be quite enough to fill them with wiki materials and support them.
The thing is that everyone knows the wiki concept - not only Drupal developers. As to the book concept, only some of the drupalers know it.
The modules that extend the standard features of Drupal Book module
Outline Designer is a module that makes book management more intuitive
Hidden Nodes module adds a system similar to publish / not publish node with distinction of roles.
Book Copy module allows users to copy full books or subtrees of books.
Book Title Override module allows you to change title of the page displayed in the menu.
Book Library module allows you to classify books by categories, it provides easier management
Booktree module displays the hierarchy as a tree for 1 book
Diff shows the difference between the versions of pages in the book
Description of Drupal Book module work
Settings for the types of content:
The list of your books will look like this:
List of book pages:
Note: if you change the page titles, they will change not only in the menu list, but also on the pages themselves.
Main page of the book:
To navigate through the books, you can use a standard block provided by the module.
In order to start using it, you just need to enable it on the block management page.
(admin > structure > block)
Here is an example of one side of the book. The main difference from the home page is that there is no block to display the hierarchy of all pages (between the page contents and links).
When you create a page for book at the bottom of the page, you need to choose a book and a parent element.
For easier editing of the book, you can use the Outline Designer module. The result of the module work:
Modal window of adding pages:
Module settings: (admin > content > book > settings)
(admin > content > book > outline_designer)
To hide the display of some pages, you can use the Hidden Nodes module.
If you need to create a copy of the book with all its pages, you can use the Book Copy module. The result of the module work:
After following the "copy book" link, you can give a name for the book copy. All the pages of this book will be automatically copied.
If you need to change the name of the page displayed in the book contents, you can use the Book Title Override module.
Example of the module use:
To create a categorization of books, you can use the Book Library module. Result of the module work:
To make the notice absent, you need to install a dev version (proof). Note: after adding this module, Book Copy stopped working. To better management of the version control system, you can use the Diff module. Result without the Diff module:
Result with the Diff module:
- configuring important issues through the book module
- a visual way of structuring content in books
- multilingual links in the navigation through the book
You need to use Drupal Book module since the first days of your website life. It can be used for: creating various types of instructions, creating the FAQ section and adding content to it, organizing co-authorship of pages, etc. Of course many of you will say “why to use this module if there are wiki-type modules.
In my opinion, there’s no point in using wiki-type modules like wiki if you can use the Drupal Book module, which will use the resources of the web server rationally.