Template:ISBN: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Undo revision 18122 by Rob Kam (talk))
No edit summary
 
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||{{#ifeq:{{yesno-yes|{{{link|}}}}}|no||ISBN (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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|ISBN}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}}}}}}}}}}}}}}}}}}}|{{error-small|Parameter error in {{tl|ISBN}}: Missing [[ISBN]].}}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using ISBN template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:ISBN]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | invalid1 | invalid2 | invalid3 | invalid4 | invalid5 | invalid6 | invalid7 | invalid8 | invalid9 | leadout | link | plainlink }}<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-name={{#ifeq:{{yesno-no|{{{noprefix|}}}}}|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|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|&nbsp;Parameter error in {{tl|ISBN}}: Invalid [[ISBN]].}}{{main other|[[Category:Pages with ISBN errors]]}}}}}}}}}}}}}}}}}}}}}}}}|{{error-small|Parameter error in {{tl|ISBN}}: Missing [[ISBN]].}}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using ISBN template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:ISBN]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | invalid1 | invalid2 | invalid3 | invalid4 | invalid5 | invalid6 | invalid7 | invalid8 | invalid9 | leadout | noprefix}}<noinclude>{{documentation}}<!-- Add categories and interwiki lines to the /doc subpage, not here! --></noinclude>

Latest revision as of 10:23, 15 July 2020

Template 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:

ISBN 0-7475-3269-9

And:

{{ISBN|978-1-4133-0454-1}}

results in:

ISBN 978-1-4133-0454-1

The idea is to switch from "magic link" syntax to more explicit syntax.

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" text should not occur (for example in longer lists), it can be suppressed using the noprefix=yes parameter:

{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|noprefix=yes}}

results in:

978-1-4133-0454-1, 978-1-4133-0454-1, 978-1-4133-0454-1

The noprefix 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|noprefix=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|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.
  • {{ISBN}}   produces Parameter error in {{ISBN}}: Missing ISBN.

Tracking categories

See also

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

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
ISBN #11

first ISBN to put in the list

Example
0-674-01181-3
Stringrequired
ISBN #22

second ISBN to put in the list

Example
0-674-04200-3
Stringsuggested
ISBN #33

third ISBN to put in the list

Example
0-674-01169-3
Stringoptional
ISBN #44

fourth ISBN to put in the list

Example
0-674-01181-6
Stringoptional
ISBN #55

fifth ISBN to put in the list

Example
0-674-02181-5
Stringoptional
66

no description

Unknownoptional
77

no description

Unknownoptional
88

no description

Unknownoptional
99

no description

Unknownoptional
Suppress link to article?link

If 'no', does not produce a link before the list

Example
no
Stringoptional
Suppress leading ISBN?noprefix

If 'yes', does not produce "ISBN: " before the list

Example
yes
Stringoptional
last list joiner textleadout

Text between second-to-last and last book ISBN's

Example
as well as
Stringoptional
invalid1invalid1

no description

Unknownoptional
invalid2invalid2

no description

Unknownoptional
invalid3invalid3

no description

Unknownoptional
invalid4invalid4

no description

Unknownoptional
invalid5invalid5

no description

Unknownoptional
invalid6invalid6

no description

Unknownoptional
invalid7invalid7

no description

Unknownoptional
invalid8invalid8

no description

Unknownoptional
invalid9invalid9

no description

Unknownoptional