Vorlage:SplitCategory/doc: Unterschied zwischen den Versionen

Aus Offene Naturführer
Wechseln zu: Navigation, Suche
Zeile 2: Zeile 2:
 
=== USAGE ===
 
=== USAGE ===
  
  <nowiki>{{SplitCategory|eins, zwei, drei}}</nowiki>
+
  <nowiki>{{SplitCategory|CatOne, CatTwo & CatThree|,|&}}</nowiki>
…creates, independently of the wikis language (i.e. working under en, de, etc.):
+
… creates, independently of the wiki language (i.e. working under en, de, etc.):
  <nowiki>[[Category:eins]] [[Category:zwei]] [[Category:drei]] </nowiki>
+
  <nowiki>[[Category:CatOne]] [[Category:CatTwo]] [[Category:CatThree]]</nowiki>
  
Technical Note: The function uses <nowiki>#replace:</nowiki>, but the replacement text must be "hidden" inside a second template <nowiki>{{Template:SplitCategory/Delimiter}}</nowiki> to avoid clean-up actions by the parser.  
+
Technical Note: The function uses a <nowiki>#replace:</nowiki> parser function, but the replacement text <tt><nowiki>]] [[{{ns:category}}:</nowiki></tt> 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:SplitCategory/Delimiter]]
+
See also [[Template:SplitLink]].
  
<includeonly>
 
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Kategorie:Kategorisierung]]
+
[[Category:Templates using string-functions]]
[[Kategorie:Vorlagen/Templates]]
+
 
</includeonly>
 
</includeonly>

Version vom 13. Juli 2010, 16:45 Uhr

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 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. </includeonly>

Quelle: Offene Naturführer, Das Wiki zu Bestimmungsfragen: Vorlage:SplitCategory/doc. Abgerufen am 2. Juni 2025, 00:43 von https://offene-naturfuehrer.de/web/Vorlage:SplitCategory/doc