සැකිල්ල:BookCat
This template is used on 75,000+ pages. 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 puts the page on which it's used ({{FULLPAGENAME}}
) into appropriate categories, based on certain page-naming and page-categorization conventions.
භාවිතය
[සංස්කරණය]When used without parameters, it
- places subpages of a book in the book's category (
ප්රවර්ගය:පොත:
) and sorts them by chapter name.{{BOOKNAME}}
- places a book's templates in the book's template category (
ප්රවර්ගය:පොත:
). This only does the right thing if a book's templates begin with{{BOOKNAME}}
/TemplatesTemplate:
.{{BOOKNAME}}
- 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/Images
would go inCategory:My Book
with sort keyImages
.
පැරාමිති
[සංස්කරණය]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
).
Optional parameter sort
or sortkey
specifies a sort key to be used for categorization instead of relying on {{BOOKSORTKEY}}.
Optional first unnamed parameter is a full page name to use instead of the {{FULLPAGENAME}}
of the current page.
An alternative template {{BookCat/diagnose}} reports the output of {{BookCat}} (with or without parameters) as an inert string, rather than categorizing the current page.
උදාහරණ
[සංස්කරණය]page where called | result |
---|---|
Taxi Tongue/Dialogue 4 |
|
Chess/Puzzles/Directmates |
|
Wikijunior:Biology |
|
Wikijunior:Dinosaurs/Apatosaurus |
|
Wikijunior talk:Bugs/Shield Bug |
|
Category:Horticulture/Templates/Boxes |
|
Category:Book:Wikijunior:Solar System/Templates |
|
Template:Wikijunior:Solar System/coolfacts |
|
User:Pi zero/Conlang/Beginner/Sounds |
|
User:Pi zero/sandbox/Conlang/Beginner/Sounds |
|
Category:User:Pi zero/sandbox/Conlang/Beginner/Sounds |
|
Template:User:Pi zero/sandbox/Conlang/Beginner/Sounds |
|
Shelf:Physical sciences |
|
Template:Shelf:Page |
|
Template:Shelf:Page/display |
|
අභ්යන්තර ක්රියාකාරීත්වය
[සංස්කරණය]This template itself only contains the logic to sort out the identity of the target page; deducing the appropriate categorization is then delegated to {{BookCat/core}}. As of this writing, parameters assembled here are namespace
, pagename
, fullpagename
, and sortkey
; the first unnamed parameter is removed, and all other parameters are passed through to the subtemplate.
ආශ්රිත
[සංස්කරණය]- See Using Wikibooks/Shelves, Categories, and Classifications#Deep filing (advanced) for more information.
- Instances are listed at
- {{BOOKCATEGORY}} is closely related.