Difference between revisions of "Template:Categorizer"

From Twinsuniverse
Jump to: navigation, search
m
Line 1: Line 1:
 
<includeonly>{{
 
<includeonly>{{
#ifeq: {{lc: {{{nocat|false}}} }} | false | [[Category:{{{category}}}]]
+
#ifeq: {{lc: {{{nocat|false}}} }} | false | {{#if:{{{category|}}}|[[Category:{{{category}}}]]}} }}{{
}}{{categorylink
+
#ifeq: {{lc: {{{display|true}}} }} | true
    |category={{{category|}}}
+
    |{{categorylink
    |catlabel={{{catlabel|list all}}}
+
        |category={{{category|}}}
    |article={{{article|}}}
+
        |catlabel={{{catlabel|list all}}}
    |label={{{label|{{{article|}}}}}}
+
        |article={{{article|}}}
 +
        |label={{{label|{{{article|}}}}}} }}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
This template is used to add a header to an infobox, labeling with and automatically categorizing the article under a category. A <nowiki>{{</nowiki>[[Template:Categorylink|Categorylink]]<nowiki>}}</nowiki> is used for display.
+
This template is used to add a header to an infobox, tagging it's articles and automatically categorizing them under a category.
 +
 
 +
All display of this template is done by the <nowiki>{{</nowiki>[[Template:Categorylink|Categorylink]]<nowiki>}}</nowiki>, and may be turned off altogether to categorize articles only.
  
 
==Parameters==
 
==Parameters==
* '''category''', '''catlabel''', '''article''', '''label''': The parameters for the [[Template:Categorylink]].
+
* '''category''': The category name to use for the [[Template:Categorylink]] and categorization (case sensitive, mandatory)
 +
* '''catlabel''', '''article''' and '''label''': Additional parameters for the [[Template:Categorylink]].
 +
* '''display''': Whether or not to display the categorylink (case insensitive, defaults to true)
 
* '''nocat''': Whether or not to suppress categorization under '''''category''''' (defaults to false, which means auto categorization).
 
* '''nocat''': Whether or not to suppress categorization under '''''category''''' (defaults to false, which means auto categorization).
  
 
==Syntax==
 
==Syntax==
 
  <nowiki>{{categorizer
 
  <nowiki>{{categorizer
  |category =
+
  |category=
  |catlabel =
+
  |catlabel=
  |article =
+
  |article=
  |label =
+
  |label=
  |nocat =
+
|display=
 +
  |nocat=
 
}}</nowiki>
 
}}</nowiki>
  
 
==Examples==
 
==Examples==
 
For explanation of the above first four parameters, see the [[Template:Categorylink|Categorylink]] template.
 
For explanation of the above first four parameters, see the [[Template:Categorylink|Categorylink]] template.
 +
 +
You may remove the display of the categorylink by specifying the "false" value for the '''display''' parameter, so these all have the same result (nothing displayed):
 +
<nowiki>{{categorizer
 +
|category=Quetch characters
 +
|catlabel=This text is simply ignored
 +
|article=As is the article
 +
|label=Forget the label
 +
|display=false
 +
}}</nowiki>
 +
<nowiki>{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=false}}</nowiki>
 +
<nowiki>{{categorizer|category=Quetch characters|display=false}}</nowiki>
 +
 +
Note that adding the value "true" to the '''nocat''' parameter to any of the above examples results in exactly the same as not calling this template.
  
 
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do):
 
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do):
Line 33: Line 52:
  
 
:[[Quetch]]{{superlink|article=:Category:Quetches|label=list all}}
 
:[[Quetch]]{{superlink|article=:Category:Quetches|label=list all}}
(and the page would '''not''' be categorized under [[:Category:Quetches]])
+
This would prevent the page from being categorized under [[:Category:Quetches]], which is useful if you only want to render the categorylink without categorization, and if using the [[Template:Categorylink|Categorylink]] directly is not desired/possible (i.e. when calling this template indirectly).
  
 
[[Category:System Templates]]</noinclude>
 
[[Category:System Templates]]</noinclude>

Revision as of 16:45, 6 December 2012

This template is used to add a header to an infobox, tagging it's articles and automatically categorizing them under a category.

All display of this template is done by the {{Categorylink}}, and may be turned off altogether to categorize articles only.

Parameters

  • category: The category name to use for the Template:Categorylink and categorization (case sensitive, mandatory)
  • catlabel, article and label: Additional parameters for the Template:Categorylink.
  • display: Whether or not to display the categorylink (case insensitive, defaults to true)
  • nocat: Whether or not to suppress categorization under category (defaults to false, which means auto categorization).

Syntax

{{categorizer
 |category=
 |catlabel=
 |article=
 |label=
 |display=
 |nocat=
}}

Examples

For explanation of the above first four parameters, see the Categorylink template.

You may remove the display of the categorylink by specifying the "false" value for the display parameter, so these all have the same result (nothing displayed):

{{categorizer
 |category=Quetch characters
 |catlabel=This text is simply ignored
 |article=As is the article
 |label=Forget the label
 |display=false
}}
{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=false}}
{{categorizer|category=Quetch characters|display=false}}

Note that adding the value "true" to the nocat parameter to any of the above examples results in exactly the same as not calling this template.

The nocat parameter may be used to suppress automatic categorization like this (any value will do):

{{categorizer
 |category=Quetches
 |article=Quetch
 |nocat=true
}}
Quetch [list all]

This would prevent the page from being categorized under Category:Quetches, which is useful if you only want to render the categorylink without categorization, and if using the Categorylink directly is not desired/possible (i.e. when calling this template indirectly).