Template:Shelves/doc

This template categorizes a book on one or more shelves in the, plus the book category.

Usage
Use this template only on the book's main page. Specify the names of the shelves as unnamed parameters, such as.

For non-shelf categories, such as descendants of Category:Books by type, use template categories.

On subpages of a book, use BookCat.

Internals
This template is responsible for adding books to the hidden allbooks categories, which allow automatic generation of lists of books belonging either to a given shelf or to any of its sub-shelves. When this template detects that it is being used on the main page of a book, for each shelf specified it calls shelves/leaf, via Module:TScope. This is why this template should only be used for shelf categories: shelves/leaf uses shelf pages to figure out which allbooks categories to add the book to, and if there are no shelf pages to consult, it reports the problem to /Attention needed. By using categories for non-subject categories, one avoids nuisance reports to /Attention needed.

The book is also added to hidden /Books; and, if no shelves are specified, to /Books/Unshelved.

If the template detects that it was called on a page that isn't the main page of a book, it does nothing.

This template can be induced to display diagnostic messages, explaining why it has put the page in /Attention needed, by specifying parameter.