Template:User book

Template documentation[edit] [history] [purge]

This userbox declares that the user contributes to a certain wikibook, and adds the user to a category associated with that book. The appearance of the userbox for a given book can be customized by that book.

UsageEdit

The template takes one required, unnamed parameter, which is the title of the book. For example,

{{User book|Using Wikibooks}}

would produce

Wikibooks-logo.svg This user contributes to the
Using Wikibooks wikibook.


The template adds the user to Category:Book:{{{1}}}/Users, where {{{1}}} is the title specified. In the example above, the user would be added to Category:Book:Using Wikibooks/Users. Calling the template with parameter nocat set to any non-null value will suppress this category, as in

{{User book|Using Wikibooks|nocat=1}}

Customization per bookEdit

By default, the userbox looks like this:

Wikibooks-logo.svg This user contributes to the
[[]] wikibook.


To specify a different appearance for a book called Title, create a template called Template:Title/User book, containing markup

{{User book/Custom|{{{1}}}|{{{2}}}|...}}

where ... are named parameters that will be passed to template {{Userbox}}. The parameters supported are (as of this writing) all those documented for {{Userbox}} except info, usercategory2, and usercategory3. If usercategory is specified, it overrides the default name for the category; and if nocat is specified with a non-null value, it prevents the category from ever being used (so that it then doesn't matter whether or not the call to {{User book}} uses nocat).

For example, the userbox is customized for Wikijunior:Languages by means of {{Wikijunior:Languages/User book}}, so that

{{User book|Wikijunior:Languages}}

produces

Languages Graphic.png This user contributes to the
Wikijunior:Languages wikibook.


A list of all these customizing templates is provided by Category:User book templates.

InternalsEdit

If the book has no customizing user template, this template calls {{User book/Custom}}. If the book does have a customizing user template, this template calls that customizing template. Either way, the first unnamed parameter to the called template is the book name (the first unnamed parameter to this template); and the second unnamed parameter to the called template is the value of the nocat parameter to this template. {{User book/Custom}} suppresses categorization in response to either the second unnamed parameter or to parameter nocat.
https://en.m.wikibooks.org/wiki/Template:User_book
en.m.wikibooks.org
crawl=CC-MAIN-2020-29
26772
application/http; msgtype=response
sha1:GB2OEEC7LTG33SWY64TN64L7UWENCDLF
<urn:uuid:0e9289c3-ecbe-476e-a385-2d2bb98cd652>
2020-07-02T20:18:44Z
208.80.154.224
text/html
sha1:53HN5S7HR2UC4Q7WXU4F2HXICTI6J222
<urn:uuid:b7182295-7cf9-42c9-bf7a-6ea21e2eb9b9>
https://en.m.wikibooks.org/wiki/Template:User_book
response
<urn:uuid:8469cde2-64c6-4122-aba6-3fa66ae97067>
isPartOf: CC-MAIN-2020-29
publisher: Common Crawl
description: Wide crawl of the web for July 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-224.ec2.internal
software: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/