Template:SBN/doc
This is a documentation subpage for Template:SBN. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
Usage
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
Formatting
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
Error checking
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}}: checksum
Tracking categories
- Category:Pages with ISBN errors (2)
- Category:Pages with listed invalid ISBNs (10)
- Category:Pages using ISBN template with unknown parameters (0)
See also
- {{ISBN}}
- {{ISBNT}}, to make an ISBN link without a visible prefix
- {{Listed Invalid ISBN}}, to link an ISBN that is invalid but printed in a source publication.
- {{PMID}}
- {{IETF RFC}}
- {{ISMN}}
- {{ISSN}}
- {{Catalog lookup link}}
- {{ISBN missing}}
Template Data
<templatedata> { "params": { "1": { "label": "SBN #1", "description": "first SBN to put in the list", "example": "340-01381-8", "type": "string", "required": true, "suggested": true }, "2": { "label": "SBN #2", "description": "second SBN to put in the list", "example": "340-01381-8", "type": "string", "suggested": true }, "3": { "label": "SBN #3", "description": "third SBN to put in the list", "example": "340-01381-8", "type": "string" }, "4": { "label": "SBN #4", "description": "fourth SBN to put in the list", "example": "340-01381-8", "type": "string" }, "5": { "label": "SBN #5", "description": "fifth SBN to put in the list", "example": "340-01381-8", "type": "string" }, "6": {}, "7": {}, "8": {}, "9": {}, "link": { "label": "Suppress link to article?", "description": "If 'no', does not produce a link to article before the list", "example": "no", "type": "string" }, "plainlink": { "label": "Suppress link to SBN?", "description": "If 'yes', does not produce \"SBN: \" before the list", "example": "yes", "type": "string" }, "leadout": { "label": "last list joiner text", "description": "Text between second-to-last and last book SBN's", "example": "as well as", "type": "string" }, "invalid1": {}, "invalid2": {}, "invalid3": {}, "invalid4": {}, "invalid5": {}, "invalid6": {}, "invalid7": {}, "invalid8": {}, "invalid9": {} }, "description": "Use this template to create a link (or list of links) to Special:BookSources for one or more Standard Book Numbers with the \"SBN\" prefix" } </templatedata>