"साँचा:BookCat": अवतरणों में अंतर

छो Removed extra line break in code.
Updated with contents of User:Pi zero/BookCat for additional functionality.
पंक्ति १:
<includeonly>{{#switch:{{NAMESPACE}}|Template={{#ifeq:"{{FULLCHAPTERNAME}}"|"{{FULLBOOKNAME}}"|[[Category:{{BOOKNAME}}/Templates|{{{1| }}}]]|[[Category:{{BOOKNAME}}/Templates|{{{1|{{FULLCHAPTERNAME}}}}}]]}}|Category={{#ifeq:"{{FULLCHAPTERNAME}}"|"{{FULLBOOKNAME}}"||[[Category:{{BOOKNAME#titleparts:{{PAGENAME}}|-1}}|{{FULLCHAPTERNAME#titleparts:{{PAGENAME}}||-1}}]]{{#ifeq:"{{FULLCHAPTERNAME}}"|"Templates"| [[Category:Book-specific templates|{{PAGENAME}}]]}}}}|#default={{#ifeq:"{{FULLCHAPTERNAME}}"|"{{FULLBOOKNAME}}"|[[Category:{{FULLBOOKNAME}}|{{{1| }}}]]|[[Category:{{FULLBOOKNAME}}|{{{1|{{FULLCHAPTERNAME}}}}}]]}} }}</includeonly><noinclude>
This template does the following, based on the page it's added to:
*Places subpages of a book in the book's category (<tt>Category:{{tlx|FULLBOOKNAME}}</tt>) and sorts them by chapter name.
*Places a book's templates in the template category ({{nowrap|<tt>Category:{{tlx|BOOKNAME}}/Templates</tt>}}). ''This only works if a book's templates begin with'' {{nowrap|<tt>Template:{{tlx|FULLBOOKNAME}}</tt>}}&nbsp;.
*Places a book's template category in the book's category and {{nowrap|[[:Category:Book-specific templates]]}}.
*Places any other of a book's categories (that starts with <tt>Category:{{tlx|FULLBOOKNAME}}/</tt>&nbsp;) in its parent, sorted by its last name. For example, {{nowrap|<tt>Category:My Book/Images</tt>}} would go in {{nowrap|<tt>Category:My Book</tt>}} with sort key <tt>Images</tt>.
 
See [[Using Wikibooks/Subjects, Categories, and Classifications#Deep filing (advanced)]] for more information.