This is the template sandbox page for Template:SBN (diff). See also the companion subpage for test cases. |
This template uses Lua: |
Use this template to create a link (or list of links) to Special:BookSources for one or more Standard Book Numbers with "SBN" prefix. The template supports 9-digit SBNs (with or without hyphens). The prefix link deliberately goes through an (identifier) redirect in order to aid reverse lookup of articles which contain SBN links from specific books (rather than only mentioning the concept of Standard Book Numbers in general).
{{SBN|340-01381-8}}
results in:
If more than one SBN is given, the template will separate them using a comma:
{{SBN|340-01381-8|340-01381-8|340-01381-8}}
results in:
SBN 340-01381-8, 340-01381-8, 340-01381-8
Alternatively the conjunction between the last two list items can be defined using the leadout=
parameter:
{{SBN|340-01381-8|340-01381-8|340-01381-8|leadout=, and}}
results in:
SBN 340-01381-8, 340-01381-8, and 340-01381-8
If the leading "SBN" link should not be linked to (for example because it was already linked to in the article), it can be suppressed using the link=no
parameter:
{{SBN|340-01381-8|340-01381-8|340-01381-8|link=no}}
results in:
SBN 340-01381-8, 340-01381-8, 340-01381-8
If the leading "SBN" link should not occur (for example in longer lists), it can be suppressed using the plainlink=yes
parameter:
{{SBN|340-01381-8|340-01381-8|340-01381-8|plainlink=yes}}
results in:
340-01381-8, 340-01381-8, 340-01381-8
The plainlink
and leadout
parameter can be used at the same time:
{{SBN|340-01381-8|340-01381-8|340-01381-8|plainlink=yes|leadout=as well as}}
results in:
340-01381-8, 340-01381-8 as well as 340-01381-8
The template preserves the formatting of the input values, for example:
{{SBN|340-01381-8|340013818|34001381-8}}
results in:
SBN 340-01381-8, 340013818, 34001381-8
This template uses Module:Check isxn to validate the SBN. If the SBN is not valid, this subtemplate will still generate the link, and it will add the article to Category:Pages with ISBN errors.
Since invalid SBNs are sometimes used in publications, it is possible to disable the validity check for individual SBNs given as parameters. In order to do so, add invalid?=yes
(with ? replaced by the parameter number 1 to 9) to the template. In this case, the article will be added to Category:Pages with listed invalid ISBNs.
{{SBN|340-01381-0}}
produces SBN 340-01381-0 Parameter error in {{SBN}}: checksum{{SBN|340-01381-0|invalid1=yes}}
produces SBN 340-01381-0{{SBN|340-01381-0|invalid1=no}}
produces SBN 340-01381-0 Parameter error in {{SBN}}: checksumUse this template to create a link (or list of links) to Special:BookSources for one or more Standard Book Numbers with the "SBN" prefix
Parameter | Description | Type | Status | |
---|---|---|---|---|
SBN #1 | 1 | first SBN to put in the list
| String | required |
SBN #2 | 2 | second SBN to put in the list
| String | suggested |
SBN #3 | 3 | third SBN to put in the list
| String | optional |
SBN #4 | 4 | fourth SBN to put in the list
| String | optional |
SBN #5 | 5 | fifth SBN to put in the list
| String | optional |
6 | 6 | no description | Unknown | optional |
7 | 7 | no description | Unknown | optional |
8 | 8 | no description | Unknown | optional |
9 | 9 | no description | Unknown | optional |
Suppress link to article? | link | If 'no', does not produce a link to article before the list
| String | optional |
Suppress link to SBN? | plainlink | If 'yes', does not produce "[[Standard Book Number|SBN]]: " before the list
| String | optional |
last list joiner text | leadout | Text between second-to-last and last book SBN's
| String | optional |
invalid1 | invalid1 | no description | Unknown | optional |
invalid2 | invalid2 | no description | Unknown | optional |
invalid3 | invalid3 | no description | Unknown | optional |
invalid4 | invalid4 | no description | Unknown | optional |
invalid5 | invalid5 | no description | Unknown | optional |
invalid6 | invalid6 | no description | Unknown | optional |
invalid7 | invalid7 | no description | Unknown | optional |
invalid8 | invalid8 | no description | Unknown | optional |
invalid9 | invalid9 | no description | Unknown | optional |