Template:BookCat
| This template is used on 27,000+ pages. (count) To avoid large-scale disruption and unnecessary server load, any changes should first be tested in the template sandbox or a user subpage. The tested changes can then be added in one single edit to this template. Please consider discussing any changes on the talk page before implementing them. |
| This template employs intricate features of template syntax.
You are encouraged to familiarize yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly. Remember that you can conduct experiments, and should test all improvements, in either the general template sandbox or your user space before changing anything here.
|
This template puts the page on which it's used ({{FULLPAGENAME}}) into appropriate categories, based on certain page-naming and page-categorization conventions.
Usage
When used without parameters, it
- places subpages of a book in the book's category (
Category:{{ROOTBOOKNAME}}) and sorts them by chapter name. - places a book's templates in the book's template category (
Category:{{ROOTBOOKNAME}}/Templates). This only works if a book's templates begin withTemplate:{{ROOTBOOKNAME}}. - places a book's template category in the book's category and in
Category:Book-specific templates. - places any other category in its parent, sorted by the category's last name. The parent has the same name except removing everything from the last slash on; and the last name is the part that was removed after that last slash. For example,
Category:My Book/Imageswould go inCategory:My Bookwith sort keyImages.
Parameters
Optional parameter filing=deep changes the behavior on book pages, so that a book page with more than one slash in its name is placed in a subcategory of the category where its parent page would be placed, sorted by the page's last name. For example, using {{BookCat|filing=deep}} on page My Book/Maps/Asia would put that page in Category:My Book/Maps with sort key Asia .
Optional parameter template-filing=deep changes the behavior on template pages to deep filing (so Template:My book/Maps/Asia would go in Category:My book/Templates/Maps).
See also
See Using Wikibooks/Subjects, Categories, and Classifications#Deep filing (advanced) for more information.