Difference between revisions of "Template:ISMN"

From blackwiki
Jump to navigation Jump to search
imported>The Anome
m (Changed protection level for "Template:ISMN": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
imported>Matthiaspaul
(New catalog lookup link-template-based enhanced version optionally supporting multiple ISMNs with full error checking and optional parameters leadout=str, plainlink=yes and invalid?=yes)
Line 1: Line 1:
{{hide in print|1=[[International Standard Music Number|ISMN]]&nbsp;{{trim|1={{{1}}}}}}}<!--
+
{{#if:{{{1|<noinclude>$</noinclude>}}}|{{Catalog lookup link|{{{id|{{{1|}}}}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|article-link={{#ifeq:{{yesno-no|{{{plainlink|}}}}}|yes||International Standard Music Number (identifier)}}|article-name={{#ifeq:{{yesno-no|{{{plainlink|}}}}}|yes||ISMN}}|list-leadout={{{leadout|}}}}}{{#if:{{trim|{{{1|}}}}}|{{#ifeq:{{yesno-no|{{{invalid1|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{1|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{2|}}}}}|{{#ifeq:{{yesno-no|{{{invalid2|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{2|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{3|}}}}}|{{#ifeq:{{yesno-no|{{{invalid3|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{3|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{4|}}}}}|{{#ifeq:{{yesno-no|{{{invalid4|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{4|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{5|}}}}}|{{#ifeq:{{yesno-no|{{{invalid5|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{5|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{6|}}}}}|{{#ifeq:{{yesno-no|{{{invalid6|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{6|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{7|}}}}}|{{#ifeq:{{yesno-no|{{{invalid7|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{7|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{8|}}}}}|{{#ifeq:{{yesno-no|{{{invalid8|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{8|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}{{#if:{{trim|{{{9|}}}}}|{{#ifeq:{{yesno-no|{{{invalid9|}}}}}|yes|{{main other|[[Category:Pages with listed invalid ISMNs]]}}|{{#invoke:check isxn|check_ismn|{{{9|}}}|error={{error|&nbsp;Parameter error in {{tl|ISMN}}: Invalid [[ISMN]].}}{{main other|[[Category:Pages with ISMN errors]]}}}}}}}}}}}}}}}}}}}}}}}}|{{error|Parameter error in {{tl|ISMN}}: Missing [[ISMN]].}}}}<noinclude>{{documentation}}<!-- Add categories and interwiki lines to the /doc subpage, not here! --></noinclude>
-->{{only in print|ISMN&nbsp;{{trim|1={{{1}}}}}}}<includeonly>{{#invoke:check isxn|check_ismn|1={{{1|}}}|error={{Please check ISMN}}{{main other|[[Category:Pages with ISMN errors]]}}}}</includeonly><noinclude>
 
{{documentation}}
 
</noinclude>
 

Revision as of 20:54, 27 August 2017

50px Template documentation[view] [edit] [history] [purge]

Usage

Use this template to create a lists of International Standard Music Numbers with or without the usual "ISMN" prefix.

Entering ISMNs

An ISMN link is created by using the {{ISMN}} template with the International Standard Music Number. Example:

  • {{ISMN|979-0-2600-0043-8}}   produces ISMN 979-0-2600-0043-8

In tables (or other applications) where the letters "ISMN" would be redundant, it can be omitted using the |plainlink= parameter.

The |leadout= parameter can be used to define a different conjunction between the last two list items.

Error checking

This template uses Module:Check isxn to validate the ISMN. If the ISMN is not valid, this subtemplate will still generate the link, and it will add the article to Category:Pages with ISMN errors.

Since invalid ISMNs are sometimes used in publications, it is possible to disable the validity check for individual ISMNs 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:Articles with invalid ISMNs.

  • ISMN 979-0-2600-0042-8 Parameter error in {{ISMN}}: Invalid ISMN.
  • ISMN 979-0-2600-0042-8

See also