Difference between revisions of "Template:SplitCategory/doc"

From OpenMedia
Jump to: navigation, search
m (+DEFAULTSORT:Categorisation)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{Documentation/subpage}}
 
{{Documentation/subpage}}
 +
 +
For a list of values, create a category link for each of the values. Optionally add display code for the categories showing the values in-place.
  
 
=== Usage ===
 
=== Usage ===
  
The {{#titleparts:  {{FULLPAGENAME}}| 1 }} assumes to get a colon-separeted input like:
+
==== Comma (or semicolon) separated ====
 +
 
 +
The {{#titleparts:  {{FULLPAGENAME}}| 1 }} assumes to get a colon-separeted input as default…
 
  <nowiki>{{SplitCategory|one, two, three}}</nowiki>
 
  <nowiki>{{SplitCategory|one, two, three}}</nowiki>
 
…and creates categories dependending on the language…
 
…and creates categories dependending on the language…
Line 12: Line 16:
 
…“one, two, three” is printed additionally right where the template is used.
 
…“one, two, three” is printed additionally right where the template is used.
  
If just “<code>replace sep for print = ,• </code>” is specified
+
If just “<code>replace sep for print = ,• </code>” is specified…
 
  <nowiki>{{SplitCategory | one, two, three | replace sep for print = ,• }}</nowiki>
 
  <nowiki>{{SplitCategory | one, two, three | replace sep for print = ,• }}</nowiki>
…a replacment is done and it looks nicely like “one&nbsp;• two&nbsp;• three” …;-)
+
…a replacment is done and it looks nicely like “one&nbsp;• two&nbsp;• three”.
 
+
  
=== See also ===
+
==== Semicolon and comma ====
 +
If using “<code>replace sep for print 1 = ;• </code>” ''and'' “<code>replace sep for print 2 = ,• </code>” is specified…
 +
<nowiki>{{SplitCategory | one, two; three | replace sep for print 1= ;• | replace sep for print 2= ,• }}</nowiki>
 +
…a replacement is done and it looks nicely like “one&nbsp;• two&nbsp;• three”. '''Beware of the order''': first ‘;’ and ''then'' ‘,’ is the recommended order, because &amp;nbsp; contains a semicolon!
  
 
<includeonly>
 
<includeonly>
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
{{DEFAULTSORT:Categorisation}}
 
 
[[Category:Classification]]
 
[[Category:Classification]]
 
</includeonly>
 
</includeonly>

Latest revision as of 15:08, 20 April 2010

This is a documentation subpage for Template:SplitCategory (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

For a list of values, create a category link for each of the values. Optionally add display code for the categories showing the values in-place.

Usage

Comma (or semicolon) separated

The Template:SplitCategory assumes to get a colon-separeted input as default…

{{SplitCategory|one, two, three}}

…and creates categories dependending on the language…

[[Category:one]] [[Category:two]] [[Category:three]] 

If “print = true”…

{{SplitCategory | one, two, three | print=true}}

…“one, two, three” is printed additionally right where the template is used.

If just “replace sep for print = ,• ” is specified…

{{SplitCategory | one, two, three | replace sep for print = ,• }}

…a replacment is done and it looks nicely like “one • two • three”.

Semicolon and comma

If using “replace sep for print 1 = ;• andreplace sep for print 2 = ,• ” is specified…

{{SplitCategory | one, two; three | replace sep for print 1= ;• | replace sep for print 2= ,• }}

…a replacement is done and it looks nicely like “one • two • three”. Beware of the order: first ‘;’ and then ‘,’ is the recommended order, because &nbsp; contains a semicolon!