This is a tutorial on creating a book using Drupal's Book module. Make sure you have talked with a website administrator for approval before you begin a book, because this type of content is not appropriate for certain kinds of content.
Please take time to read the bottom section of this page because it has some important and helpful tips and guidelines for using books.
Basics: Beginning a book
1. Go to add content
2. Go to Book page
3. To start a new book entitled "My Book" enter the Title and the Body.
4. Under the body section chose the "Full HTML" text format to have control over book page formatting beyond the basics.
5. After the title and content are entered we will need to go to the lower left navigation, below the body field, and select <Book outline>.
5. Then under book we select <create a new book>.
6. Select <Save>. Now we have created our first book with this top-level page. You will now see the book's title and body, and as admin we have tabs to edit and build out our book.
7. (optional) If we ever need to go back in and change the books title or the content seen on the first page of our new book we click <Edit>.
Chapters and Sub-sections
Now we can begin adding chapters and organization to our newly created book. We are viewing the book's top-level page "My Book" which we just created. When we selected <create a new book>, after giving a title and body to the page we created in the above section, we made it so this entry became the title and top-level page of our new book --> it can be referred to as the top-level page "My Book." Once we have created the book the easiest way to edit is to select Content >> Books >> My Book from the admin menu when logged in.
For the next part in this tutorial we will give our book some chapters. First of all create the first chapter by clicking on the "add child page" link which is to the lower right of the "My Book" top-level page. Give the page the title, "My Chapter 1". Then place text for the chapter in the body field. Select <Book Outline> from the lower-left navigation. Select the appropriate book for the chapter to appear in --> in this case "My Book". Then under the book we select the parent item. The parent item of "My Chapter 1" is "My Book". So in this case the book and the parent item are the same. Then click <Save>.
*If we were adding a page that was to appear as a sub-section of the first chapter we would select "My Chapter 1" as the parent item, and we would still select "My Book" as the book. Then click <Save>.
"My Chapter 1" is now created. We want this chapter of the book divided into four sections. The outline for the book will be as follows:
My Book (top-level page and book title)
- My Chapter 1
A.Creating content in Drupal
I. Content Types in Drupal
II. Block display for content
B.Editing content in Drupal
C.Theming in Drupal
D.Taking Drupal-oriented Vacations
2. My Chapter 2
To add another chapter we would navigate to the top-level page of our book ("My Book") and click <add child page>. To create the sections for Chapter 1 we would need to navigate to the chapter, "My Chapter 1." Then we would click on the <add child page> link and create the sections. If we then wanted a sub-section of the section we could do the same thing. For example to create the sub-section "Content Types in Drupal" we would navigate to it's parent page -->"Creating content in Drupal"-->then we would click on the <add child page> link. The most important thing to remember is to always create the child pages from their parent page. If you clicked the <add child page> link from "My chapter 1" to create the "Content Types in Drupal" sub-section our book would not have the organization we want.
This is how books are put together. All of the child pages will be visible navigation links under their parent pages. So the books' table of contents' will by dynamically generated. When we look at the child pages, the ones which have children are designated by the small triangle beside the page title. Children that do not have children are designated by the small circle beside the title. On every page of the book, at the bottom of the book content section, we will see a couple of horizontal lines with links on the left, right and sometimes middle. The left and right links will take you the item before and after the current page displayed. The <up> link, which is in the middle, will take you to the parent item of the page you are viewing.
Organizing and Re-Arranging your Book
Once we have some structure we may need to re-organize chapters or section within a book.
1. Go to the top-level part of our book "My Book" then select <outline>. Now from this outline window we can re-organize pages, chapters and sections of a book by weight on an item by item basis - if you would like to use weighting to organize items in Drupal you can check out the following documentation http://www.drupal.org/node/144221 . There is another way to organize books, and I will outline this preferred method now.
2. From that same outline window notice the first sentence ending with the following link: "reorder an entire book." Click on the link, then select "edit order and titles" link to the right of the book you wish to organize. Now you are at the drag and drop interface for re-organizing our book! Simply click above the cross to the left of the page titles and drag and drop to re-organize content. You can also change titles here.
***A few things to keep in mind about Books in Drupal -- not in order of importance --***
- A good option is to include a big image -- say 480 pixels wide -- as the body content for our top-level page. An example of this can be found currently on our drupal site for the 2011-2012 Factbook. Here you see the image is the main content of the page, and underneath we can see the children pages as active links.
- Typically we will not need "Table of Contents" page. The reason is once we have our child pages for the chapters they will automatically become links beneath the content. The only reason for a table of contents page would be for a book that have abnormal structures that would require navigation beyond the natural way the book module organizes content.
- If a book is relative to a year, make sure the year is included in the book title.
- WYSIWYG Etiquette: We need to keep consistent style guidelines in the body content of our books. The reason is that if we can keep the style simple and consistent while we develop the content we will then easily be able to apply CSS to further style entire elements by class. It is VERY important we follow these conventions for now:
- Remove all formatting from content before it is pasted into the WYSIWYG. Typically I will copy and paste text from the source (.pdf, .doc, etc) into the Notepad accessory. Then I organize the un-formatted content in a logical way in notepad. Then when I have the content logically arranged and spaced in Notepad I will paste it into the WYSIWYG.
- For headings in the pages I highlight and click the "B" on the top bar to make them bold.
- For asides and imperatives I highlight then click "I" to make italic.
- If we need to link text or images within a book to external content I highlight and then click the chain icon to bring up the "insert/edit link" window.
- For lists and sections I use bulleted lists. If there is content that is a list within a list or a section within a section I will choose the numbered list option.
- We can use the indent button at the top of the WYSIWYG to indent blocks of content in our pages. The outdent button will undo the indent once that section of our page is set.
- We can use the alignment buttons to center our text if needed.
- For content that is best fit in tables use the Table Wizard in the WYSIWYG. It is the tic-tac-toe icon with yellow pencil beside of the styles select list on the top bar of the WYSIWG editor when "Full HTML" is enabled.
- Links within the WYSIWYG need to be considered. If the link is to an external site (a link to content not in our current site or in our drupal site) then it is safe to go ahead and enter the full url into the link field, of course remember the http:// prefix. For links that are in our drupal site remember to use a relative link (i.e. one without the full url, contact me if you are unsure about this one)
- -Of course images can be placed in the WYSIWYG by clicking the tree icon. Just in case you have not uploaded an image from the "insert/edit image" window here is a refresher:
1. Click on the browse icon to the right of the image url field. 2. Select upload from the blue bar at the top of the file browser window. 3. Then select Choose File and choose the web-optimized file you wish to use (in photoshop create the file, select the appropriate image size, then click [ctrl]+[alt]+[shift]+[s] and save your item as a PNG -- without transparency. 4. Then click upload 5. Then click on the image you uploaded to the web server click insert.
**Other than these guidelines for use, let's not apply any further styling to our body content from the WYSIWYG. That means keep the font size and color of all text the same default settings, drupal will automatically make links blue and underlined. It we follow these guidelines CSS can effectively style big portions of our site easily. If we start applying classes in the WYSIWYG we lose that ability. One other neat little feature is to click on the html button. From here you can see the code behind the WYSIWYG.