Difference between revisions of "Template:ISBN/doc"

Jump to navigation Jump to search
m (1 revision imported)
 
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
{{Lua|Module:Check isxn}}
 
{{Lua|Module:Check isxn}}
{{High-risk|380000+}}
 
 
<!-- 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).
+
Use this template to create a link (or list of links) to [[Special:BookSources]] for one or more [[w:International Standard Book Number|International Standard Book Number]]s with the usual "ISBN" prefix. The template supports 10- and 13-digit ISBNs (with or without hyphens).
   
 
<code><nowiki>{{ISBN|0-7475-3269-9}}</nowiki></code>
 
<code><nowiki>{{ISBN|0-7475-3269-9}}</nowiki></code>
Line 21: Line 20:
 
{{ISBN|978-1-4133-0454-1}}
 
{{ISBN|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 "[[mw:Help:Magic links|magic link]]" syntax to more explicit syntax.
   
 
If more than one ISBN is given, the template will separate them using a comma:
 
If more than one ISBN is given, the template will separate them using a comma:
Line 39: Line 38:
 
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=, and}}
 
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=, and}}
   
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 <code>link=no</code> parameter:
+
If the leading "ISBN" text should not occur (for example in longer lists), it can be suppressed using the <code>noprefix=yes</code> parameter:
   
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|link=no}}</nowiki></code>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|noprefix=yes}}</nowiki></code>
   
 
results in:
 
results in:
   
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|link=no}}
+
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|noprefix=yes}}
   
 
The <code>noprefix</code> and <code>leadout</code> parameter can be used at the same time:
If the leading "ISBN" link should not occur (for example in longer lists), it can be suppressed using the <code>plainlink=yes</code> parameter:
 
   
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}}</nowiki></code>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|noprefix=yes|leadout=as well as}}</nowiki></code>
   
 
results in:
 
results in:
   
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}}
+
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|noprefix=yes|leadout=as well as}}
 
(Alternatively the {{tl|ISBNT}} template can be used.)
 
 
The <code>plainlink</code> and <code>leadout</code> parameter can be used at the same time:
 
 
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes|leadout=as well as}}</nowiki></code>
 
 
results in:
 
 
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes|leadout=as well as}}
 
   
 
=== Formatting ===
 
=== Formatting ===
Line 94: Line 83:
   
 
===See also===
 
===See also===
* [[Wikipedia:ISBN]]
+
* [[w:Wikipedia:ISBN]]
* {{tl|SBN}}, similar template for SBNs rather than ISBNs
 
* {{tl|ISBNT}}, to make an ISBN link without a visible prefix
 
* {{tl|Listed Invalid ISBN}}, to link an ISBN that is invalid but printed in a source publication.
 
* {{tl|Format ISBN}}, to hyphenate an ISBN according to official rules
 
* {{tl|PMID}}
 
* {{tl|IETF RFC}}
 
* {{tl|ISMN}}
 
* {{tl|ISSN}}
 
 
* {{tl|Catalog lookup link}}
 
* {{tl|Catalog lookup link}}
* {{tl|ISBN missing|date=August 2019}}
 
   
 
==Template Data==
 
==Template Data==
Line 153: Line 133:
 
"type": "string"
 
"type": "string"
 
},
 
},
"plainlink": {
+
"noprefix": {
"label": "Suppress link to ISBN?",
+
"label": "Suppress leading ISBN?",
"description": "If 'yes', does not produce \"[[ISBN]]: \" before the list",
+
"description": "If 'yes', does not produce \"ISBN: \" before the list",
 
"example": "yes",
 
"example": "yes",
 
"type": "string"
 
"type": "string"

Latest revision as of 10:25, 15 July 2020

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

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