Vorlage:SplitCategory: Unterschied zwischen den Versionen
Aus Offene Naturführer
K |
K (use arraymap) |
||
Zeile 1: | Zeile 1: | ||
− | <includeonly> | + | <includeonly>{{#arraymap: {{#replace:{{#replace:{{#replace:{{{1}}}|{{{3|&}}}|{{{2|,}}}}}|{{{2|,}}}|{{SplitCategory/Delimiter}}}}|\|}}}}<!-- values |
+ | -->|,<!-- split on , | ||
+ | -->|§<!-- assign temporary variable | ||
+ | -->|[[{{ns:category}}:§]][[dcterms:subject::§| ]]<!-- output | ||
+ | -->|<!-- new output separator | ||
+ | -->}}</includeonly><noinclude>{{Documentation}} | ||
[[Category:Single-access key templates]]</noinclude> | [[Category:Single-access key templates]]</noinclude> |
Version vom 17. Juli 2016, 19:45 Uhr
[Bearbeiten] [ ]
Dokumentation der Vorlage
USAGE
{{SplitCategory|CatOne, CatTwo & CatThree|,|&}}
… creates, independently of the wiki language (i.e. working under en, de, etc.):
[[Category:CatOne]] [[Category:CatTwo]] [[Category:CatThree]]
Technical dependencies
Technical Note: The function uses a #replace: parser function, but the replacement text ]] [[{{ns:category}}: must be "hidden" inside a second template (Template:SplitCategory/Delimiter). Without this trick the brackets will not result in valid links, due to some cleanup/sanitizer code present in the parser.
See also Template:SplitLink.