Skip to main content

Making a Tutorial

April 28, 2010 by Steve

I like the idea of the tutorial ending with a discussion of how to make a tutorial. It is really pretty straightforward, since we only need to turn on one more core module to get the basic functions.

If we use the Drupal jargon, we could say the Book module allows us to aggregate arbitrary nodes into hierarchical collections. For regular people, that means you can pull together any of your blog posts or other content into groups of related items. They don't have to have been made at the same time, or be part of the same categories, or related in any other way. The book module adds the links at the bottom of the post that lead to other parts of the book. This is how all the documentation on the Drupal site is done.

Go to module administration and turn on the Book module. (You already have it, it is part of core.) Then go to Content Management > Books > Settings and take a look at your options. You can choose what content types can be part of a Book, and if you create a new "Book" piece, what does it default to. I set mine so that Page, Story, and Book nodes could be brought into a book, and that the default for a new Book page would be Story.

Now we have to edit our taxonomy rules so that they apply to book-type content. Go to Content Management > Taxonomy and click on "edit vocabulary" for Sections. Under content type, check the checkbox for Book, and save out. Do the same for the Topics vocabulary.

Since the nodes are already all visible, there are no extra permissions needed to let people see the book pages. You might want to go to User Management > Permissions and give Anonymous users "access printer-friendly version", though. The printer-friendly link will generate a single page showing the entire book with a clean, printable format.

Under Content Management > Content Types > Edit Book, you can set the default publishing options for your new Book nodes. I changed the name from Book to Tutorial, simply because I could. I set the other defaults to match the settings I used for Story and Page nodes. Don't forget to save your settings.

There is no top level menu entry for creating a new book. Instead, go to the node that you want to be the top page of your new tutorial. Edit this node (or create a new one). While editing, you'll see a new set of options labeled "Book Outline". There is a pulldown menu labeled "Book", which will show . Change it to . The name of this node becomes the name of your new book. Save your changes.

You can go back and edit other nodes to add them to the Book in the same way, choosing the book first, and then which item will be the parent. Going forward, when making new content, you'll have the option to add it to the book right from the start.

Sub-pages of a given page will show in alphabetical order unless you adjust their weights. You can manage this by hand for a small number of pages, but after a while, that might get difficult. You might also want to change the pages around in a more drastic way, make a new chapter, or something like that. For this, there's the Content Management > Books page. Click on the "edit and order titles" link for the book you want to edit. Don't forget to save your changes when you're done.

The book module also allows you to add the Book navigation block to your layout. The block is designed to show titles of all available books, and expand the menu when you are inside one of them. There are no elegant ways to make it expanded all the time, though there are some hacks that allow it. I didn't bother.

On the Site Building > Blocks page, I found the Book Navigation block and put it in the Right Top block. (I had it in column 3 at first, but as the book got bigger, it looked ugly in the narrow column, so I moved it up to the double-wide area above columns 3 and 4.) I used the Skinr settings to give it a border and slightly rounded corners (which can be seen if you are not using IE for browsing.) And I set it to only show up if you were browsing the book already. I already have the Build This Site link in the main menu bar, so I don't need the extra link floating up there all the time.

Now I just need to keep making the tutorial better.


  • @rosamundlannin I make regular chili but use that veggie crumble meat substitute stuff. 7 years 27 weeks ago
  • @Snarky_Geek Since I was awake at 4:30 this morning, and finally just gave up and went to work around 5:45, I feel your pain. 7 years 28 weeks ago
  • One of the Chicago office dogs really wants to play this morning @the_nerdery, keeps bringing toys over to try to start something. 7 years 36 weeks ago

Premium Drupal Themes by Adaptivethemes