Difference between revisions of "Template:ISBN/doc"

From Yugipedia
Jump to: navigation, search
 
m (1 revision imported: mass import/update of Wikipedia stuff)
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
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 [[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>
+
<code><nowiki>{{ISBN|0-7475-3269-9}}</nowiki></code>
  
 
results in:
 
results in:
Line 15: Line 15:
 
And:
 
And:
  
<tt><nowiki>{{ISBN|978-1-4133-0454-1}}</nowiki></tt>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1}}</nowiki></code>
  
 
results in:
 
results in:
  
 
{{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.
 
  
 
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:
  
<tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1}}</nowiki></tt>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1}}</nowiki></code>
  
 
results in:
 
results in:
Line 31: Line 29:
 
{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1}}
 
{{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 <tt>leadout=</tt> parameter:
+
Alternatively the conjunction between the last two list items can be defined using the <code>leadout=</code> parameter:
 +
 
 +
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=, and}}</nowiki></code>
 +
 
 +
results in:
 +
 
 +
{{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:
  
<tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|leadout=and}}</nowiki></tt>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|link=no}}</nowiki></code>
  
 
results in:
 
results in:
  
{{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|link=no}}
  
It the leading "ISBN" link should not occur (for example in longer lists), it can be suppressed using the <tt>plainlink=yes</tt> parameter:
+
If the leading "ISBN" link should not occur (for example in longer lists), it can be suppressed using the <code>plainlink=yes</code> parameter:
  
<tt><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}}</nowiki></tt>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1|978-1-4133-0454-1|978-1-4133-0454-1|plainlink=yes}}</nowiki></code>
  
 
results in:
 
results in:
Line 49: Line 55:
 
(Alternatively the {{tl|ISBNT}} template can be used.)
 
(Alternatively the {{tl|ISBNT}} template can be used.)
  
The <tt>plainlink</tt> and <tt>leadout</tt> parameter can be used at the same time:
+
The <code>plainlink</code> and <code>leadout</code> 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>
+
<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:
 
results in:
Line 61: Line 67:
 
The template preserves the formatting of the input values, for example:
 
The template preserves the formatting of the input values, for example:
  
<tt><nowiki>{{ISBN|978-1-4133-0454-1|978141330454-1|978 1-41330-454-1}}</nowiki></tt>
+
<code><nowiki>{{ISBN|978-1-4133-0454-1|978141330454-1|978 1-41330-454-1}}</nowiki></code>
  
 
results in:
 
results in:
Line 70: Line 76:
 
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]].
+
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 <code>invalid?=yes</code> (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]].
 +
 
 +
* <code><nowiki>{{ISBN|1-4133-0451-0}}</nowiki></code> &nbsp; produces {{ISBN|1-4133-0451-0}}
  
* <tt><nowiki>{{ISBN|1-4133-0451-0}}</nowiki></tt> &nbsp; produces {{ISBN|1-4133-0451-0}}
+
* <code><nowiki>{{ISBN|1-4133-0451-0|invalid1=yes}}</nowiki></code> &nbsp; produces {{ISBN|1-4133-0451-0|invalid1=yes}}
  
* <tt><nowiki>{{ISBN|1-4133-0451-0|invalid1=yes}}</nowiki></tt> &nbsp; produces {{ISBN|1-4133-0451-0|invalid1=yes}}
+
* <code><nowiki>{{ISBN|1-4133-0451-0|invalid1=no}}</nowiki></code> &nbsp; produces {{ISBN|1-4133-0451-0|invalid1=no}}
  
* <tt><nowiki>{{ISBN|1-4133-0451-0|invalid1=no}}</nowiki></tt> &nbsp; produces {{ISBN|1-4133-0451-0|invalid1=no}}
+
* <code><nowiki>{{ISBN}}</nowiki></code> &nbsp; produces {{ISBN}}
  
* <tt><nowiki>{{ISBN}}</nowiki></tt> &nbsp; produces {{ISBN}}
+
===Tracking categories===
 +
*{{clc|Pages with ISBN errors}}
 +
*{{clc|Pages with listed invalid ISBNs}}
 +
*{{clc|Pages using ISBN template with unknown parameters}}
  
 
===See also===
 
===See also===
 
* [[Wikipedia:ISBN]]
 
* [[Wikipedia:ISBN]]
 +
* {{tl|SBN}}, similar template for SBNs rather than ISBNs
 
* {{tl|ISBNT}}, to make an ISBN link without a visible prefix
 
* {{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|Listed Invalid ISBN}}, to link an ISBN that is invalid but printed in a source publication.
 +
* {{tl|OCLC}}, to link directly to Worldcat; useful for books with no ISBN.
 
* {{tl|PMID}}
 
* {{tl|PMID}}
 
* {{tl|IETF RFC}}
 
* {{tl|IETF RFC}}
Line 89: Line 102:
 
* {{tl|ISSN}}
 
* {{tl|ISSN}}
 
* {{tl|Catalog lookup link}}
 
* {{tl|Catalog lookup link}}
 
+
* {{tl|ISBN missing|date=August 2019}}
<includeonly>
 
[[Category:Catalog lookup templates]]
 
[[Category:International Standard Book Number templates]]
 
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]
 
</includeonly>
 
  
 
==Template Data==
 
==Template Data==
Line 108: Line 116:
 
"suggested": true
 
"suggested": true
 
},
 
},
"2": {},
+
"2": {
"3": {},
+
"label": "ISBN #2",
"4": {},
+
"description": "second ISBN to put in the list",
"5": {},
+
"example": "0-674-04200-3",
 +
"type": "string",
 +
"suggested": true
 +
},
 +
"3": {
 +
"label": "ISBN #3",
 +
"description": "third ISBN to put in the list",
 +
"example": "0-674-01169-3",
 +
"type": "string"
 +
},
 +
"4": {
 +
"label": "ISBN #4",
 +
"description": "fourth ISBN to put in the list",
 +
"example": "0-674-01181-6",
 +
"type": "string"
 +
},
 +
"5": {
 +
"label": "ISBN #5",
 +
"description": "fifth ISBN to put in the list",
 +
"example": "0-674-02181-5",
 +
"type": "string"
 +
},
 
"6": {},
 
"6": {},
 
"7": {},
 
"7": {},
 
"8": {},
 
"8": {},
 
"9": {},
 
"9": {},
"plainlink": {},
+
"link": {
"leadout": {},
+
"label": "Suppress link to article?",
 +
"description": "If 'no', does not produce a link before the list",
 +
"example": "no",
 +
"type": "string"
 +
},
 +
"plainlink": {
 +
"label": "Suppress link to ISBN?",
 +
"description": "If 'yes', does not produce \"[[ISBN]]: \" before the list",
 +
"example": "yes",
 +
"type": "string"
 +
},
 +
"leadout": {
 +
"label": "last list joiner text",
 +
"description": "Text between second-to-last and last book ISBN's",
 +
"example": "as well as",
 +
"type": "string"
 +
},
 
"invalid1": {},
 
"invalid1": {},
 
"invalid2": {},
 
"invalid2": {},
Line 131: Line 176:
 
}
 
}
 
</templatedata>
 
</templatedata>
 +
 +
<includeonly>{{Sandbox other||
 +
[[Category:Catalog lookup templates]]
 +
[[Category:International Standard Book Number templates]]
 +
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]
 +
}}</includeonly>

Latest revision as of 23:46, 1 April 2023

Usage[edit]

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

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[edit]

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[edit]

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

Tracking categories[edit]

See also[edit]

Template Data[edit]

<templatedata> { "params": { "1": { "label": "ISBN #1", "description": "first ISBN to put in the list", "example": "0-674-01181-3", "type": "string", "required": true, "suggested": true }, "2": { "label": "ISBN #2", "description": "second ISBN to put in the list", "example": "0-674-04200-3", "type": "string", "suggested": true }, "3": { "label": "ISBN #3", "description": "third ISBN to put in the list", "example": "0-674-01169-3", "type": "string" }, "4": { "label": "ISBN #4", "description": "fourth ISBN to put in the list", "example": "0-674-01181-6", "type": "string" }, "5": { "label": "ISBN #5", "description": "fifth ISBN to put in the list", "example": "0-674-02181-5", "type": "string" }, "6": {}, "7": {}, "8": {}, "9": {}, "link": { "label": "Suppress link to article?", "description": "If 'no', does not produce a link before the list", "example": "no", "type": "string" }, "plainlink": { "label": "Suppress link to ISBN?", "description": "If 'yes', does not produce \"ISBN: \" before the list", "example": "yes", "type": "string" }, "leadout": { "label": "last list joiner text", "description": "Text between second-to-last and last book ISBN'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 International Standard Book Numbers with the usual \"ISBN\" prefix" } </templatedata>