Difference between revisions of "Template:LCCN/doc"

From blackwiki
Jump to navigation Jump to search
imported>He7d3r
m (→‎See also: *bugzilla:8160: ParserFunction for Library of Congress Control Numbers (LCCN))
imported>Funandtrvl
(→‎See also: update)
 
(19 intermediate revisions by 14 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
+
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
  
===Usage===
+
==Usage==
This template is used for referring to books by their [[Library of Congress Control Number]]s. Split the number into 3 parameters:
+
This template is used for referring to books by their [[Library of Congress Control Number]]s. Enter the LCCN without any dashes or vertical bars between the numbers.
#the numbers before the dash
 
#if the number after the dash is not 6 digits long, enough zeroes to make it so
 
#the numbers after the dash
 
  
E.g.: to link 89-456 it'll be
+
===Examples===
#89
+
For example, to link 89-456, use:<br/>
#000
 
#456
 
  
<nowiki>{{LCCN|89|000|456}}</nowiki> gives
+
<code><nowiki>{{LCCN|89456}}</nowiki></code> gives
{{LCCN|89|000|456}}
+
:{{LCCN|89456}}
  
To link a number that already has 6 digits after the dash, leave the 2nd parameter empty. E.g.: for 71-143545
+
and to link sa65-3567, use:<br/>
#71
 
#&nbsp;
 
#143545
 
  
<nowiki>{{LCCN|71||143545}}</nowiki> gives
+
<code><nowiki>{{LCCN|sa653567}}</nowiki></code> gives
{{LCCN|71||143545}}
+
:{{LCCN|sa653567}}
  
If the LCCN has 8 digits and no dash, treat it as if there is a dash after the second number.  E.g. for 71143545
+
===Additional parameters===
#71
+
You can use a second parameter to add a title.
#&nbsp;
 
#143545
 
  
<nowiki>{{LCCN|71||143545}}</nowiki> gives
+
<code><nowiki>{{LCCN|89456|Monarch butterflies}}</nowiki></code>
{{LCCN|71||143545}}
+
:{{LCCN|89456|Monarch butterflies}}
  
If the LCCN has 10 digits and no dash, put the first four numbers (the year it was assigned) in the first parameter, leave the second parameter blank, and put the last six numbers in the third parameter. E.g.: for 2001022631
+
By specifying <code>| long = yes</code>, you can also provide a more detailed output, especially for use in External Links sections:
#2001
 
#&nbsp;
 
#022631
 
  
<nowiki>{{LCCN|2001||022631}}</nowiki> gives
+
<code><nowiki>{{LCCN|89456|long=yes}}</nowiki></code> gives
{{LCCN|2001||022631}}
+
:{{LCCN|sa653567|long=yes}}
  
If the LCCN contains two letters, add them before the normal 1st parameter:
+
You can also use the second parameter to specify the book title if the page where the name of the article you're working on is not identical to the work you're citing. This is often true in the case of parenthetical disambiguation:
<nowiki>{{LCCN|sa65|00|3567}}</nowiki> gives
 
{{LCCN|sa65|00|3567}}
 
  
===See also===
+
<code><nowiki>{{LCCN|89456|Monarch butterflies|long=yes}}</nowiki></code> gives
*[http://lccn.loc.gov/lccnperm-faq.html LCCN Permalink FAQ], Library of Congress
+
:{{LCCN|sa653567|Monarch butterflies|long=yes}}
 +
 
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
"params": {
 +
"1": {
 +
"aliases": [
 +
"id"
 +
],
 +
"label": "LCCN id",
 +
"description": "LCCN without hyphens",
 +
"example": "89456",
 +
"type": "string",
 +
"required": true
 +
},
 +
"2": {
 +
"aliases": [
 +
"title",
 +
"name"
 +
],
 +
"label": "Title",
 +
"description": "Title of the book",
 +
"example": "Monarch butterflies",
 +
"type": "string"
 +
},
 +
"long": {
 +
"label": "Long format",
 +
"description": "yes to use the long format",
 +
"example": "yes",
 +
"type": "boolean"
 +
}
 +
},
 +
"description": "References a Library of Congress Control Number."
 +
}
 +
</templatedata>
 +
 
 +
==See also==
 +
*[https://lccn.loc.gov/lccnperm-faq.html LCCN Permalink FAQ], Library of Congress
 
*[[bugzilla:8160]]: ParserFunction for Library of Congress Control Numbers (LCCN)
 
*[[bugzilla:8160]]: ParserFunction for Library of Congress Control Numbers (LCCN)
<includeonly>
+
*{{tl|LCC}}
<!-- ADD CATEGORIES BELOW THIS LINE -->
+
*{{tl|LCCN8}} – for adding LCCNs from [[Chronicling America]]
{{DEFAULTSORT:LCCN}}
 
[[Category:Book templates]]
 
[[Category:United States government attribution templates]]
 
[[Category:U.S. Government external link templates]]
 
  
<!-- ADD INTERWIKIS BELOW THIS LINE -->
+
<includeonly>{{Sandbox other||
[[de:Vorlage:LCCN]]
+
[[Category:Catalog lookup templates]]
[[es:Plantilla:LCCN]]
+
[[Category:International Standard Book Number templates]]
[[ja:Template:LCCN]]
+
[[Category:United States government external link templates]]
[[pt:Predefinição:LCCN]]
+
}}</includeonly>
[[ro:Format:LCCN]]
 
[[ru:Шаблон:LCCN]]
 
[[simple:Template:LCCN]]
 
[[sv:Mall:LCCN]]
 
[[uk:Шаблон:LCCN]]
 
[[zh:Template:LCCN]]
 
</includeonly>
 

Latest revision as of 18:29, 18 October 2020

Usage

This template is used for referring to books by their Library of Congress Control Numbers. Enter the LCCN without any dashes or vertical bars between the numbers.

Examples

For example, to link 89-456, use:

{{LCCN|89456}} gives

LCCN Expression error: Unrecognized punctuation character "[". 89-Expression error: Unrecognized punctuation character "[".Template:Only in print

and to link sa65-3567, use:

{{LCCN|sa653567}} gives

LCCN Expression error: Unrecognized punctuation character "[". sa65-Expression error: Unrecognized punctuation character "[".Template:Only in print

Additional parameters

You can use a second parameter to add a title.

{{LCCN|89456|Monarch butterflies}}

LCCN Expression error: Unrecognized punctuation character "[". 89-Expression error: Unrecognized punctuation character "[". – Monarch butterfliesTemplate:Only in print

By specifying | long = yes, you can also provide a more detailed output, especially for use in External Links sections:

{{LCCN|89456|long=yes}} gives

Catalog record for LCCN/doc at the United States Library of Congress

You can also use the second parameter to specify the book title if the page where the name of the article you're working on is not identical to the work you're citing. This is often true in the case of parenthetical disambiguation:

{{LCCN|89456|Monarch butterflies|long=yes}} gives

Catalog record for Monarch butterflies at the United States Library of Congress

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for LCCN

References a Library of Congress Control Number.

Template parameters

ParameterDescriptionTypeStatus
LCCN id1 id

LCCN without hyphens

Example
89456
Stringrequired
Title2 title name

Title of the book

Example
Monarch butterflies
Stringoptional
Long formatlong

yes to use the long format

Example
yes
Booleanoptional

See also