Difference between revisions of "Template:LCCN"

From blackwiki
Jump to navigation Jump to search
imported>Bsadowski1
m (Protected Template:LCCN: Highly visible template ([edit=autoconfirmed] (indefinite)))
imported>Headbomb
(per discussion)
Line 1: Line 1:
<includeonly><!--
+
{{#if:{{{3|}}}
-->{{#if:{{{3|}}}|<!--
+
|{{hide in print|1=[[Library of Congress Control Number|LCCN]]&nbsp;[http://lccn.loc.gov/{{{1|}}}{{padleft:{{{3|}}}|{{#expr:10-({{str len|{{{1|}}}}}+{{str len|{{{3|}}}}})}}|0}} {{{1|}}}{{padleft:{{{3|}}}|{{#expr:10-({{str len|{{{1|}}}}}+{{str len|{{{3|}}}}})}}|0}}]}}<!--
Legacy code to handle old uses:
+
-->{{only in print|1=LCCN&nbsp;{{{1|}}}{{padleft:{{{3|}}}|{{#expr:10-({{str len|{{{1|}}}}}+{{str len|{{{3|}}}}})}}|0}}}}[[Category:Articles using legacy format in Template:LCCN]]
-->{{LCCN/core|1={{{1}}}|2={{{3}}} }}[[Category:Articles using legacy format in Template:LCCN]]<!-- End legacy code.
+
|{{#if:{{{1|}}}
-->|<!--Smart code using just one parameter:-->{{LCCN/prepare
+
  |{{hide in print|1=[[Library of Congress Control Number|LCCN]]&nbsp;[http://lccn.loc.gov/{{{1|}}} {{{1|}}}]}}<!--
|{{{1|}}}
+
-->{{only in print|1=LCCN&nbsp;{{{1|}}}}}
|{{#iferror:{{#expr:{{padleft:|2|{{{1|}}} }} }}|2
+
}}
|{{#ifeq:{{padright:{{{1|}}}|10|x}}|{{{1|}}}|2|0}} }} }}<!--
+
}}<noinclude>
-->}}</includeonly><noinclude>
 
 
{{documentation}}
 
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
 
 
</noinclude>
 
</noinclude>

Revision as of 15:40, 1 April 2012

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

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 89456Template:Only in print

and to link sa65-3567, use:

{{LCCN|sa653567}} gives

LCCN sa653567Template:Only in print

Additional parameters

You can use a second parameter to add a title.

{{LCCN|89456|Monarch butterflies}}

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

LCCN sa653567Template:Only in print

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

LCCN sa653567Template:Only in print

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