Difference between revisions of "Template:NameTrick"

From AtlasWiki
Jump to: navigation, search
(Created page with "<noinclude> This template emulates the "pipe trick", but items in parenthesis are retained. </noinclude>{{#arraydefine:colonSplit|{{{1}}}|:}}{{{1}}}|{{#switch:{{#arraysize:c...")
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 
This template emulates the "pipe trick", but items in parenthesis are retained.
 
This template emulates the "pipe trick", but items in parenthesis are retained.
</noinclude>{{#arraydefine:colonSplit|{{{1}}}|:}}[[{{{1}}}|{{#switch:{{#arraysize:colonSplit}}| 1 = {{#explode:{{{1}}}}} | #default = {{#explode:{{#arrayindex:colonSplit|1}}}}]]
+
</noinclude>{{#arraydefine:colonSplit|{{{1}}}|:}}[[{{{1}}}|{{#switch:{{#arraysize:colonSplit}}| 1 = {{{1}}} | #default = {{#ifeq:{{#arrayindex:colonSplit|0}}|XCSG|{{#arrayindex:colonSplit|1}}|{{{1}}}}}}}]]

Latest revision as of 16:45, 23 October 2015

This template emulates the "pipe trick", but items in parenthesis are retained. [[{{{1}}}|{{{1}}}]]