Template:ISBN: Difference between revisions
Template>MRD2014 (bypass redirect per talk) |
Template>Matthiaspaul (Changed back to go through (identifier) redirect for the reasons discussed on template's talk page.) |
||
Line 1: | Line 1: | ||
{{#if:{{{1|<noinclude>$</noinclude>}}}|{{Catalog lookup link|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|article-link={{#ifeq:{{yesno-no|{{{plainlink|}}}}}|yes||International Standard Book Number}}|article-name={{#ifeq:{{yesno-no|{{{plainlink|}}}}}|yes||ISBN}}|link-prefix=[Special:BookSources/|item-prefix={{!}}|item-postfix=]|list-leadout={{{leadout|}}}}}{{#if:{{trim|{{{1|}}}}}|{{#ifeq:{{yesno-no|{{{invalid1|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{1|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{2|}}}}}|{{#ifeq:{{yesno-no|{{{invalid2|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{2|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{3|}}}}}|{{#ifeq:{{yesno-no|{{{invalid3|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{3|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{4|}}}}}|{{#ifeq:{{yesno-no|{{{invalid4|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{4|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{5|}}}}}|{{#ifeq:{{yesno-no|{{{invalid5|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{5|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{6|}}}}}|{{#ifeq:{{yesno-no|{{{invalid6|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{6|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{7|}}}}}|{{#ifeq:{{yesno-no|{{{invalid7|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{7|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{8|}}}}}|{{#ifeq:{{yesno-no|{{{invalid8|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{8|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{9|}}}}}|{{#ifeq:{{yesno-no|{{{invalid9|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{9|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}}}}}}}}}}}}}}}}}}}|{{error-small|Parameter error in {{tl|isbn<!-- ISBN -->}}: Missing [[ISBN]].}}}}<noinclude>{{documentation}}<!-- Add categories and interwiki lines to the /doc subpage, not here! --></noinclude> | {{#if:{{{1|<noinclude>$</noinclude>}}}|{{Catalog lookup link|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|article-link={{#ifeq:{{yesno-no|{{{plainlink|}}}}}|yes||International Standard Book Number (identifier)}}|article-name={{#ifeq:{{yesno-no|{{{plainlink|}}}}}|yes||ISBN}}|link-prefix=[Special:BookSources/|item-prefix={{!}}|item-postfix=]|list-leadout={{{leadout|}}}}}{{#if:{{trim|{{{1|}}}}}|{{#ifeq:{{yesno-no|{{{invalid1|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{1|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{2|}}}}}|{{#ifeq:{{yesno-no|{{{invalid2|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{2|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{3|}}}}}|{{#ifeq:{{yesno-no|{{{invalid3|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{3|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{4|}}}}}|{{#ifeq:{{yesno-no|{{{invalid4|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{4|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{5|}}}}}|{{#ifeq:{{yesno-no|{{{invalid5|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{5|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{6|}}}}}|{{#ifeq:{{yesno-no|{{{invalid6|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{6|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{7|}}}}}|{{#ifeq:{{yesno-no|{{{invalid7|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{7|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{8|}}}}}|{{#ifeq:{{yesno-no|{{{invalid8|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{8|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}{{#if:{{trim|{{{9|}}}}}|{{#ifeq:{{yesno-no|{{{invalid9|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISBNs]]}}|{{#invoke:check isxn|check_isbn|{{{9|}}}|error={{error-small| Parameter error in {{tl|isbn<!-- ISBN -->}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}}}}}}}}}}}}}}}}}}}|{{error-small|Parameter error in {{tl|isbn<!-- ISBN -->}}: Missing [[ISBN]].}}}}<noinclude>{{documentation}}<!-- Add categories and interwiki lines to the /doc subpage, not here! --></noinclude> |
Revision as of 06:06, 11 December 2017
This template uses Lua: |
This template is used on 461,000+ pages, or roughly 1115% of all 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. |
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:
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 conjunction 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
If the leading "ISBN" should not be a link (for example because it is already linked in the article), the link can be suppressed using the link=no
parameter:
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|link=no}}
results in:
ISBN 978-1-4133-0454-1, 978-1-4133-0454-1, 978-1-4133-0454-1
If 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
Formatting
The template preserves the formatting of the input values, for example:
{{ISBN|978-1-4133-0454-1|978141330454-1|978 1-41330-454-1}}
results in:
ISBN 978-1-4133-0454-1, 978141330454-1, 978 1-41330-454-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 calling template requires template_name parameter
{{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 calling template requires template_name parameter
Tracking categories
- Category:Pages with ISBN errors (1)
- Category:Pages with listed invalid ISBNs (1)
- Category:Pages using ISBN template with unknown parameters (0)
See also
- Wikipedia:ISBN
- {{SBN}}, similar template for SBNs rather than ISBNs
- {{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.
- {{Format ISBN}}, to hyphenate an ISBN according to official rules
- {{OCLC}}, to link directly to Worldcat; useful for books with no ISBN.
- {{PMID}}
- {{IETF RFC}}
- {{ISMN}}
- {{ISSN}}
- {{Catalog lookup link}}
- {{ISBN missing}}
Template Data
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
Parameter | Description | Type | Status | |
---|---|---|---|---|
ISBN #1 | 1 | first ISBN to put in the list
| String | required |
ISBN #2 | 2 | second ISBN to put in the list
| String | suggested |
ISBN #3 | 3 | third ISBN to put in the list
| String | optional |
ISBN #4 | 4 | fourth ISBN to put in the list
| String | optional |
ISBN #5 | 5 | fifth ISBN 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 before the list
| String | optional |
Suppress link to ISBN? | plainlink | If 'yes', does not produce "[[ISBN]]: " before the list
| String | optional |
last list joiner text | leadout | Text between second-to-last and last book ISBN'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 |