Last modified on 23 May 2013, at 15:03

Using Wikibooks/Subjects, 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 even harder 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 {{BookCat}} on the bottom of every page in the book, except the main page
  • The template {{Subjects|Foo|Bar}} on the bottom of the book's main page (see below for what to use instead of "Foo" or "Bar")
  • The exact same {{Subjects|Foo|Bar}} template (with exactly the same list of subjects) on the bottom of the book's category page
  • The {{book category header}} template at the top of the book's category page

Subjects and categoriesEdit

As a reader, browsing the subject pages allows you to find books on the topic of your choice. As a writer, you have an interest in having your book appear in the subject of your choice. The subject pages are dynamically generated, meaning you cannot add your book to a subject page directly to have it appear there. Each subject page has wiki markup in it that specifies a certain category to look in for pages that will be then displayed on the subject page. When you file your book's main page in that special category, it will appear on the corresponding subject page. 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 subject in which you are filing the main page of your book. If they were, every page of your book would show up on the subject page, overwhelming all the other books and destroying the value of the subject page. Instead, they should be filed in a category whose name is the title of your book. The details of this are explained below.

Keeping these two types of categories straight can be difficult, and so the category a book's main page is filed in is often referred to as a subject category, since anything filed in it appears in a subject 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. You might wonder if a book category and subject category might ever have the same name, resulting in havoc. Several factors ensure that this does not happen. Subject pages correspond exactly to the category that they "pull" from to make filing a book's main page easier and, by convention, subjects have been named using Sentence case. Books are normally titled using Title Case. Using these conventions, subject category and book category name conflicts are avoided, permitting situations such as Category:Emergency Medicine acting as the book category for Emergency Medicine and Category:Emergency medicine acting as the subject category for Emergency Medicine.

Filing your book's main pageEdit

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 subject pages and on pages used for other methods of finding books.

Subject categoryEdit

If you have spent the time determining your book's subject matter and scope, then you will have an easier time determining what subject category to file it in. The top-level subjects all contain more specific subjects within them. Only in the rarest of cases will your book be filed in a top-level subject category, and if you believe it belongs there you should consider narrowing the scope of the book. A book needs to be placed in the most specific subject possible, and usually only needs to be placed in one subject. A more specific subject is one of many that are encompassed by a less specific subject, so there is no need to file a book in both. For instance, a book filed in Subject:Constructed languages does not also need to be filed in Subject:Languages since the former is one of many subjects that are part of 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 in Subject:Educational software should not be filed in Subject:Microsoft Windows as well simply because it covers a program that runs on Windows.

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

Alphabetical classificationEdit

Finally, 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 {{Alphabetical|*}} 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 pagesEdit

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 category with the same name as your book's title. Directly means that 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 filingEdit

The simplest method of filing your book's pages is to put them all in the category of your book's name directly. If your book's name is Foo Bar the category would be Category:Foo Bar. This could be done with [[Category:Foo Bar]]. 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 Foo Bar, all the pages would show up under F. Rather than manually specifying sorting on a per-page basis, use the {{BookCat}} template at the bottom of every page to sort the page based on the portion after the title. Foo Bar/Blah would be sorted based on Blah. You can also add {{BookCat}} 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. Add a description to the top of it and preferably also add a link to your book's main page as well. Most importantly, file your book's category in the subject category that your book's main page is filed in. The subject pages do not show categories, only pages, so this allows people viewing a subject's corresponding category to see both your book's main page and your book's individual category.

You can use the very same code you placed on your book's main page — {{Subjects|Foo}} or {{Subjects|Foo|Bar}} — on the bottom of your book's category, where Foo and Bar are subject category names.

Deep filing (advanced)Edit

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):

My Book
My Book/Foo My Book/Bar
My Book/Foo/Page My Book/Bar/Page

Category:My Book would still exist and be filed in the same subject category as the book, as with flat filing. However, additional categories would be created for all the pages under Foo and Bar, with those categories filed in Category:My Book. Pages in the Foo chapter would be in Category:My Book/Foo and pages in the Bar chapter would be in Category:My Book/Bar.

The code used for this method is similar to that used in the flat filing method. Add {{BookCat|filing=deep}} 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 chapter and all the pages of 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 {{BookCat}}. 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.

You can use this technique if you have many templates in use by your book as well. If My Book had several templates, it could use Category:My Book/Templates for even more control. Templates can be filed by having {{BookCat}} placed inside the template, which will ignore the Template: portion of their name when sorting them inside of a /Templates subcategory. Add the template subcategory to your book's category with {{BookCat}} on the bottom of the category page.

To conclude the demonstration by example, Category:My Book would end up looking like the following using deep filing:

Category:My Book
My Book
My Book/Foo
My Book/Bar
Category:My Book/Foo
My Book/Foo/Page
Category:My Book/Bar
My Book/Bar/Page
Category:My Book/Images
Category:My Book/Templates