Using Wikibooks/Shelves, Categories, and Classifications

If you've read ../Finding A Wikibook/, then you see that there are many ways to find a Wikibook on the topic of your choice. However, whether starting a new book or expanding heavily on a book that is merely a stub, you need to ensure that your book is visible to both readers and potential contributors. The terminology used in Wikibooks for the various methods of organization can be confusing, and the proper implementation of those methods on your book can be hard to grasp. After reading the following sections you should have a better idea how this all works.

To help make the entire book visible to readers and potential contributors, most books have:


 * the template  on the bottom of every page in the book, except the main page.
 * The template  on the bottom of the book's main page (see below for a detailed explanation).
 * The template  at the bottom of the book's category page.
 * The template  at the top of the book's category page.
 * The template ' or, in some cases, ' on subcategory pages of the book's category.

Shelves and categories
As a reader, browsing the shelves allows you to find books on the topic of your choice. As a writer, you have an interest in having your book appear on the shelf of your choice. The shelf contents are dynamically generated, meaning you cannot add your book to a shelf directly to have it appear there. Each shelf page has wiki markup in it that specifies a certain category to look in for pages that will be then displayed on the shelf. When you file your book's main page in that special category, it will appear on the corresponding shelf, and on larger shelves covering wider topics that encompass the topic of the smaller shelf. The details of how to do this are explained later.

The pages of your book also need to be filed in a category, but they should not be filed in the special category that matches up to the shelf in which you are filing the main page of your book. If they were, every page of your book would show up separately on the shelf, flooding the shelf display so it wouldn't be useful at all. Instead, they should be filed in a category whose name is based on the title of your book. The details of this are explained below.

Keeping these two types of categories straight is important. The category a book's main page is filed in is referred to as a shelf category, since anything filed in it appears on a shelf page. The category the rest of the book's pages are filed in is referred to as a book category, since everything filed in it should pertain only to a single book. Several naming conventions prevent confusion between book categories and shelf categories.

The name of a shelf category has a  prefix, followed by exactly the name of the corresponding shelf; the name of a book category has a   prefix, and is otherwise exactly the name of the book's main page. Also, by convention, normally shelves are named using while books are titled using. For example, there is (as of this writing) a book Emergency Medicine and a shelf ; the book main page is Emergency Medicine, the shelf page is Shelf:Emergency medicine, the book category is Category:Book:Emergency Medicine, and the shelf category is Category:Shelf:Emergency medicine.

Filing your book's main page
Your book's main page is key to having your book be found by those who would have an interest in it. Several pieces of code need to be added to it for your book to appear both on shelf pages and on pages used for other methods of finding books.

Shelf category
If you have spent the time determining your book's subject matter and scope, then you will have an easier time determining what shelf category to file it in. At the top level, all the shelves are grouped into departments. Most of the top-level shelves within a department have subshelves within them, perhaps a given subshelf may have further subshelves within it, and so on. Although most departments do have a shelf with the same name as the department, containing general references, usually when your book seems to belong on that general-references shelf you should consider narrowing the scope of the book.

A book should be placed on the most-specific shelf possible, and usually only needs to be placed on one shelf. A more specific shelf is one of many that are encompassed by a less specific shelf, so there is no need to file a book in both. For instance, a book filed on Shelf:Constructed languages does not also need to be filed on Shelf:Languages since the former is one of many shelves that are contained within the latter.

Also, file your book based on the topic it actually covers and not topics that would only be related tangentially. For example, a book filed on Shelf:Educational software should not be filed on Shelf:Microsoft Windows as well simply because it covers a program that runs on Windows.

The hard part is figuring out what shelf best matches your book's content. The easy part is actually putting the main page in the shelf category that corresponds to the most-specific shelf you want it to show up on. Simply place ' or ' on the bottom of your book's main page, where  and   are shelf names. As mentioned earlier, less is more, so do not overdo it.

Alphabetical classification
The alphabetical classification system allows people to search for a book by the first letter or number in its title. This is especially helpful if someone is looking for several books on the same topic that all start out with the same first word in the title.

The easiest of all the methods you have at your disposal for filing your book, simply add  to the bottom of your book's main page, where  is the first letter or number in your book's title. Use your discretion as to whether to count the words "A" or "The" as the first words of your title for the purposes of filing. Ideally, if those words are not necessary, they should not be added to the beginning of the title in the first place.

Filing your book's chapters and pages
The rest of the pages of your book should not have any of the above bits of code added to them. They need to be filed, either directly or indirectly, in the book category of your book. Directly means they are filed specifically in that category, while indirectly means they are filed in another category that is itself filed in your book's category. Placing all your pages into a book category allows for an alphabetical index of pages to complement your book's table of contents, without having to generate such an index manually. When you create a new page in your book and add it to your book's category, it automatically appears in this index.

As you learned in ../How To Structure A Wikibook/, your pages can be structured using a flat method or one using chapters. How you file the pages within your book's category also depends on personal preference and the conventions used by your book.

Flat filing
The simplest method of filing your book's pages is to put them all in the book category directly. If your book's name is the category would be. This could be done with. This is not the ideal option, however.

The pages should be sorted within the category to make it easier to locate them. If you do not specify the method of this sorting, they will all show up under the first letter of your book's name. Continuing the example of, all the pages would show up under. Rather than manually specifying sorting on a per-page basis, use the template at the bottom of every page to sort the page based on the portion after the title. would be sorted based on. You can also add in a template included on all your pages for the same effect.

You will notice that the category added to the bottom of the pages is red. You need to click it and create the category before it will exist. Simply call templates book category header and BookCat on the new page; the first of these templates will generate a message linking to the book's main page, and the second template will file your book's category in the shelf category(-ies) that your book's main page is filed in. The shelf pages do not list categories, only pages, so this allows people viewing a shelf's corresponding category to see both your book's main page and your book's individual category.

Book item categories
If your book has peripheral pages associated with it, such as templates or images, that aren't subpages of the book's main page, you should keep track of these using subcategories of the book's category, one subcategory for each kind of peripheral page. This sort of peripheral subcategory should be named with the book category name followed by a slash and the kind of peripheral, capitalized. For example, if your book is called, so that its book category is , a subcategory for gizmos associated with the book should be called. Create the peripheral subcategory containing a call to template book item category header, which will automatically file the subcategory in the book category and generate a header explaining what the subcategory is. For some kinds of peripherals, book item category header also knows to file the subcategory in one or another reserved administrative category.

Usually, peripheral templates of a book are named, the name of a book, and possibly a slash and a specific name. Book might have a template, or perhaps one called  if the purpose of the template is especially universal to the book. Templates with names like these can be filed by putting BookCat on the template, which will ignore the  portion of their name and sort them into a   subcategory.

Images don't follow this sort of naming convention. For these, use, where  is the name of your book, such as. You can also use this way for templates that don't follow the usual naming convention but are associated with a particular book.

You may also use subcategories like this for some supplementary grouping(s) of its pages, independent of its table of contents, such as stubs. Use book item category header on the subcategory &mdash; especially if it's for stubs, because the template automatically knows to put those in a reserved administrative category &mdash; and (or , etc.) on the selected book pages to file them there. Usually this is done by a template, such as. (When BOOKCATEGORY and BOOKSORTKEY are used on a page of the book, they don't need to be told the name of the book since they can figure it out from the name of the page.)

Deep filing (advanced)
If you have structured your book using chapters and a deep structure, you may have hundreds of pages. That many pages in your book's category can become unwieldy. The more advanced option is to file pages within each chapter inside separate categories that are in turn filed in your book's category. This technique can be understood better by using an example. Take a book with the following pages (not as many as would actually be used for this method):

would still exist and be filed in the same shelf category as the book, as with flat filing. However, additional categories would be created for all the pages under  and , with those categories filed in. Pages within the  chapter would be in  and pages within the   chapter would be in.

The code used for this method is similar to that used in the flat filing method. Add to the bottom of the pages or in a template placed on all the pages, which will automatically file the pages into subcategories of the root book category. The pages will be sorted based on the first letter of the page rather than the first letter of the chapter, and all the pages within the same chapter are inside a unique category.

When creating the categories for each chapter's pages by clicking the red link that appears at the bottom of the page, add the category to the book's category with. This puts the chapter category into the book's category and sorts it based on the chapter's name, rather than the first letter of the book's name.

To conclude the demonstration by example, would end up looking like the following using deep filing:
 * Category:Book:My Book
 * My Book
 * My Book/Foo
 * My Book/Bar
 * Category:Book:My Book/Foo
 * My Book/Foo/Page
 * Category:Book:My Book/Bar
 * My Book/Bar/Page
 * Category:Book:My Book/Images
 * Category:Book:My Book/Templates