m (Arcology Expert Program moved page Template:SplitLink to Template:SplitLink) |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Documentation}} | {{Documentation}} | ||
<includeonly><onlyinclude> | <includeonly><onlyinclude> | ||
{{#loop: p-loop | {{#ifexpr:{{#count:{{{1}}}|;}}=0 | ||
|{{#ifexist:{{{1}}}|[[{{{1}}}]]|{{{1}}}}} | |||
|{{#loop: p-loop | |||
| 0 | | 0 | ||
| {{#count:{{{1}}}|;}} | | {{#count:{{{1}}}|;}} | ||
| {{#vardefine:p-name|{{#explode:{{{1}}}|;|{{#var:p-loop}}}}}}{{#ifexist:{{#var:p-name}}|[[{{#var:p-name}}]]|{{#var:p-name}}}}{{#ifexpr:{{#var:p-loop}} + 1 = {{#count:{{{1}}}|;}}||, }} | | {{#vardefine:p-name|{{#explode:{{{1}}}|;|{{#var:p-loop}}}}}}{{#ifexist:{{#var:p-name}}|[[{{#var:p-name}}]]|{{#var:p-name}}}}{{#ifexpr:{{#var:p-loop}} + 1 = {{#count:{{{1}}}|;}}||, }} | ||
}}</onlyinclude></includeonly> | }}</onlyinclude></includeonly> | ||
Revision as of 17:02, 23 January 2023
Template:SplitLink is used to break up lists of (potential) references to other pages and create links if they exist.
Usage
It accepts one mandatory string parameter, a delimited list of article titles.
It accepts two optional string parameters, which can be used to control what delimiters are used.
in(default;) controls the delimiter used for the input.out(default,) controls the delimiter used for the output.
Return
It returns a delimited list of article titles, as links if the article exists or as plain text if it does not.
For example,{{SplitLink|Mattias Torrez; Shirayuri}} returns: {{#ifexpr:1=0 |Mattias Torrez; Shirayuri
|Mattias Torrez{{SplitLink|SCIRE, Level 3, Mall|in=,}} returns: {{#ifexpr:0=0 |SCIRE, Level 3, Mall
|The documentation above was transcluded from Template:SplitLink/Documentation. [edit]
