Difference between revisions of "Template:ISBN/doc"
test>Jonesey95 (add link to listed invalid ISBN) |
test>Matthiaspaul (Updated documentation) |
||
| Line 4: | Line 4: | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
== Usage == | == Usage == | ||
| − | < | + | Use this template to create a link (or list of links) to [[Special:BookSources]] for one or more [[International Standard Book Number]]s with the usual "ISBN" prefix. The template supports 10- and 13-digit ISBNs (with or without hyphens). |
| + | |||
| + | <tt><nowiki>{{ISBN|0-7475-3269-9}}</nowiki></tt> | ||
| + | |||
| + | results in: | ||
| + | |||
| + | {{ISBN/sandbox|0-7475-3269-9}} | ||
| + | |||
| + | And: | ||
| + | |||
| + | <tt><nowiki>{{ISBN|978-1-4133-0454-1}}</nowiki></tt> | ||
results in: | results in: | ||
| − | {{ISBN| | + | {{ISBN/sandbox|978-1-4133-0454-1}} |
The idea is to switch from "[[Help:Magic links|magic link]]" syntax to more explicit syntax. {{oldid2|772133164|Future of magic links|This March 2017 (English Wikipedia) RfC}} determined the magic link should be replaced by this template. | The idea is to switch from "[[Help:Magic links|magic link]]" syntax to more explicit syntax. {{oldid2|772133164|Future of magic links|This March 2017 (English Wikipedia) RfC}} determined the magic link should be replaced by this template. | ||
| + | |||
| + | If more than one ISBN is given, the template will separate them using a comma: | ||
| + | |||
| + | <tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1}}</nowiki></tt> | ||
| + | |||
| + | results in: | ||
| + | |||
| + | {{ISBN/sandbox|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1}} | ||
| + | |||
| + | Alternatively the conjugation between the last two list items can be defined using the <tt>leadout=</tt> parameter: | ||
| + | |||
| + | <tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=and}}</nowiki></tt> | ||
| + | |||
| + | results in: | ||
| + | |||
| + | {{ISBN/sandbox|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=and}} | ||
| + | |||
| + | It the leading "ISBN" link should not occur (for example in longer lists), it can be suppressed using the <tt>plainlink=yes</tt> parameter: | ||
| + | |||
| + | <tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}}</nowiki></tt> | ||
| + | |||
| + | results in: | ||
| + | |||
| + | {{ISBN/sandbox|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}} | ||
| + | |||
| + | (Alternatively the {{tl|ISBNT}} template can be used.) | ||
| + | |||
| + | The <tt>plainlink</tt> and <tt>leadout</tt> parameter can be used at the same time: | ||
| + | |||
| + | <tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes|leadout=as well as}}</nowiki></tt> | ||
| + | |||
| + | results in: | ||
| + | |||
| + | {{ISBN/sandbox|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes|leadout=as well as}} | ||
===Error checking=== | ===Error checking=== | ||
This template uses [[Module:Check isxn]] to validate the ISBN. If the ISBN is not valid, this subtemplate will still generate the link, and it will add the article to [[:Category:Pages with ISBN errors]]. | This template uses [[Module:Check isxn]] to validate the ISBN. If the ISBN is not valid, this subtemplate will still generate the link, and it will add the article to [[:Category:Pages with ISBN errors]]. | ||
| + | |||
| + | Since invalid ISBNs are sometimes used in publications, it is possible to disable the validity check for individual ISBNs given as parameters. In order to do so, add <tt>invalid?=yes</tt> (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]]. | ||
| + | |||
| + | * <tt><nowiki>{{ISBN|1-4133-0451-0}}</nowiki></tt> produces {{ISBN/sandbox|1-4133-0451-0}} | ||
| + | |||
| + | * <tt><nowiki>{{ISBN|1-4133-0451-0|invalid1=yes}}</nowiki></tt> produces {{ISBN/sandbox|1-4133-0451-0|invalid1=yes}} | ||
| + | |||
| + | * <tt><nowiki>{{ISBN|1-4133-0451-0|invalid1=no}}</nowiki></tt> produces {{ISBN/sandbox|1-4133-0451-0|invalid1=no}} | ||
| + | |||
| + | * <tt><nowiki>{{ISBN}}</nowiki></tt> produces {{ISBN/sandbox}} | ||
===See also=== | ===See also=== | ||
| Line 23: | Line 77: | ||
* {{tl|ISMN}} | * {{tl|ISMN}} | ||
* {{tl|ISSN}} | * {{tl|ISSN}} | ||
| + | * {{tl|Catalog lookup link}} | ||
<includeonly> | <includeonly> | ||
[[Category:Catalog lookup templates]] | [[Category:Catalog lookup templates]] | ||
[[Category:International Standard Book Number templates]] | [[Category:International Standard Book Number templates]] | ||
| + | [[Category:Wikipedia formatting and function templates|{{PAGENAME}}]] | ||
</includeonly> | </includeonly> | ||
Revision as of 12:09, 4 September 2017
| This is a documentation subpage for Template:ISBN. It contains usage information, categories and other content that is not part of the original template page. |
| File:Lua-Logo.svg | This template uses Lua: |
| This template is used on 444,000+ pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. Transclusion count updated automatically (see documentation). |
Usage
Use this template to create a link (or list of links) to Special:BookSources for one or more International Standard Book Numbers with the usual "ISBN" prefix. The template supports 10- and 13-digit ISBNs (with or without hyphens).
{{ISBN|0-7475-3269-9}}
results in:
And:
{{ISBN|978-1-4133-0454-1}}
results in:
The idea is to switch from "magic link" syntax to more explicit syntax. This March 2017 (English Wikipedia) RfC determined the magic link should be replaced by this template.
If more than one ISBN is given, the template will separate them using a comma:
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1}}
results in:
ISBN 978-1-4133-0454-1, 978-1-4133-0454-1, 978-1-4133-0454-1
Alternatively the conjugation between the last two list items can be defined using the leadout= parameter:
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=and}}
results in:
ISBN 978-1-4133-0454-1, 978-1-4133-0454-1 and 978-1-4133-0454-1
It the leading "ISBN" link should not occur (for example in longer lists), it can be suppressed using the plainlink=yes parameter:
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}}
results in:
978-1-4133-0454-1, 978-1-4133-0454-1, 978-1-4133-0454-1
(Alternatively the {{ISBNT}} template can be used.)
The plainlink and leadout parameter can be used at the same time:
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes|leadout=as well as}}
results in:
978-1-4133-0454-1, 978-1-4133-0454-1 as well as 978-1-4133-0454-1
Error checking
This template uses Module:Check isxn to validate the ISBN. If the ISBN is not valid, this subtemplate will still generate the link, and it will add the article to Category:Pages with ISBN errors.
Since invalid ISBNs are sometimes used in publications, it is possible to disable the validity check for individual ISBNs 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.
- {{ISBN|1-4133-0451-0}} produces ISBN 1-4133-0451-0 Parameter error in {{isbn}}: Invalid ISBN.
- {{ISBN|1-4133-0451-0|invalid1=yes}} produces ISBN 1-4133-0451-0
- {{ISBN|1-4133-0451-0|invalid1=no}} produces ISBN 1-4133-0451-0 Parameter error in {{isbn}}: Invalid ISBN.
See also
- Wikipedia: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}}