Difference between revisions of "Template:LCCN/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Headbomb
imported>AManWithNoPlan
(update to match actual template)
Line 1: Line 1:
{{#if:{{{3|}}}
+
<includeonly><!--
|{{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}}]}}<!--
+
-->{{#if:{{{3|}}}|<!--
-->{{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]]
+
Legacy code to handle old uses:
|{{#if:{{{1|}}}
+
-->{{LCCN/core|1={{{1}}}|2={{{3}}} }}[[Category:Articles using legacy format in Template:LCCN]]<!-- End legacy code.
  |{{hide in print|1=[[Library of Congress Control Number|LCCN]]&nbsp;[http://lccn.loc.gov/{{{1|}}} {{{1|}}}]}}<!--
+
-->|<!--Smart code using just one parameter:-->{{LCCN/prepare
-->{{only in print|1=LCCN&nbsp;{{{1|}}}}}
+
|{{{1|}}}
}}
+
|{{#iferror:{{#expr:{{padleft:|2|{{{1|}}} }} }}|2
}}
+
|{{#ifeq:{{padright:{{{1|}}}|10|x}}|{{{1|}}}|2|0}} }} }}<!--
 +
-->}}</includeonly>

Revision as of 04:14, 12 February 2015