Template:Tlg: Difference between revisions

361 bytes added ,  10 years ago
Update linking logic so "anypage" is not needed anymore; remove unused and undocumented LANG and SISTER parameters
(Allow empty parameters to be specified (whatever this is good for). At least it simplifies documentation.)
(Update linking logic so "anypage" is not needed anymore; remove unused and undocumented LANG and SISTER parameters)
Line 3:
<span style="white-space:nowrap;">
--><!--
 
-- begin tt style if tt=yes or code=yes given
-->{{#if:{{{tt|}}}{{{code|}}}|<code>}}<!--
Line 11 ⟶ 12:
-- begin boldface if bold=yes given
-->{{#if:{{{bold|}}}|'''}}<!--
 
-- begin link if not nolink=yes; add any LANG and SISTER prefixes
-- specifycreate page toactual link to(if (unlessnot nolink=yes)
-->{{#if:{{{nolink|}}}||{{!(}}{{!(}}{{{LANG|}}}{{{SISTER|}}}<!--
-->{{#if:{{{nolink|}}}
-- specify page to link to (unless nolink=yes)
|<!-- nolink=yes -->
-->{{#if:{{{1|}}}|{{#if:{{{anypage|}}}||{{ns:Template}}:}}{{{1|}}}|{{FULLPAGENAME}}}}{{!}}}}<!--
|{{#ifeq:{{padleft:|1|{{{1}}}}} <!-- check whether we have a colon at the beginning -->
|:
|{{!(}}{{!(}}:{{FULLPAGENAME:{{{1}}}}} <!-- if yes: link to article ns or assume other valid link, e.g. Interwikilink -->
|{{!(}}{{!(}}:{{#switch:{{NAMESPACE:{{{1}}}}}
|{{ns:0}}|{{ns:10}}={{ns:10}}:{{PAGENAME:{{{1}}}}} <!-- No ns given: we want to link to template ns -->
|#default={{FULLPAGENAME:{{{1}}}}}<!--
-->}}<!--
-->}}{{!}}<!-- <<--- pipe character in link
-->}}<!--
 
-- create link text
-- opening brace if braceinside=yes
-->{{#if:{{{braceinside|}}}|<nowiki>{{</nowiki>}}<!--
Line 23 ⟶ 35:
-- end of link, unless nolink=yes
-->{{#if:{{{nolink|}}}||]]}}<!--
 
-- end boldface if bold=yes given
-->{{#if:{{{bold|}}}|'''}}<!--
-- begin italic style if italic=yes given
-->{{#if:{{{italic|}}}|<span style="font-style: italic;">}}<!--
 
-- add the remaining parameters
-->{{#ifeq:{{{2|}}}|{{{2|x}}}|&#124;{{{2}}}}}<!--
-->{{#ifeq:{{{3|}}}|{{{3|x}}}|&#124;{{{3}}}}}<!--
Line 39 ⟶ 53:
-->{{#ifeq:{{{11|}}}|{{{11|x}}}|&#124;{{{11}}}}}<!--
-->{{#if:{{{12|}}}|&#124;''...''}}<!--
 
-- end italic style if italic=yes given
-->{{#if:{{{italic|}}}|</span>}}<!--
Anonymous user