Difference between revisions of "Template:LCCN/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Smith609
(Support 10-digit LCCNs)
imported>Headbomb
(test)
Line 1: Line 1:
<!--
+
{{#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}}}}
-->{{LCCN/core|1={{{1}}}|2={{{3}}} }}<!-- End legacy code.
+
|{{#if:{{{1|0123456789}}}
-->|<!--Smart code using just one parameter:-->{{LCCN/prepare
+
  |{{hide in print|1=[[Library of Congress Control Number|LCCN]]&nbsp;[http://lccn.loc.gov/{{{1|0123456789}}} {{{1|0123456789}}}]}}<!--
|{{{1|}}}
+
-->{{only in print|1=LCCN&nbsp;{{{1|}}}}}
|{{#iferror:{{#expr:{{padleft:|2|{{{1|}}} }} }}|2
+
}}
|{{#ifeq:{{padright:{{{1|}}}|10|x}}|{{{1|}}}|2|0}} }} }}<!--
+
}}
-->}}<noinclude>
 
{{documentation}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
 
</noinclude>
 

Revision as of 16:21, 31 March 2012