Difference between revisions of "Template:Categorizer"

From Twinsuniverse
Jump to: navigation, search
(eliminated the display parameter of the categorizer)
m (forgot to remove manual categorization)
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
     |article={{{article|}}}
 
     |article={{{article|}}}
 
     |label={{{label|{{{article|}}}}}}}}
 
     |label={{{label|{{{article|}}}}}}}}
}}</includeonly><noinclude>
+
}}</includeonly><noinclude>{{Infobox Template
This template is used to add a heading to an infobox, tagging it's articles and automatically categorizing them under a category. The display of this heading may be turned off to merely categorize an article, and in such cases this template makes sure there is no output where it is called, so that infobox rows may gracefully collapse rather than remaining empty.
+
|purpose=infobox
 +
|singletag=no
 +
|multiline=no
 +
|gamerelated=no
 +
|suppressible=yes
 +
|choice=single
 +
|cat1=!''by parameter '''category'''''
 +
|var1=infobox_messages!Infobox!active
 +
}}
  
All actual display of this template is managed by the <nowiki>{{</nowiki>[[Template:Categorylink|Categorylink]]<nowiki>}}</nowiki>.
+
This template is used in articles to automatically categorize them under a category, and to display a representation of the category. The display is in the form of a {{templatelink|categorylink}}. This display may also be turned off to merely categorize an article.
 +
 
 +
When this is used in an infobox, this will append the categorization to a variable, to allow the infobox to sort its categories. When the display is then turned off, in which case this template would make sure there is no output, the related row may gracefully collapse rather than showing empty.
  
 
==Parameters==
 
==Parameters==
* '''category''': The category name to use for the [[Template:Categorylink]] and categorization (case sensitive, mandatory)
+
* '''category''': The category name to use for the {{templatelink|categorylink}} and categorization (case sensitive, mandatory)
* '''catlabel''', '''article''' and '''label''': Additional parameters for the [[Template:Categorylink]].
+
* '''catlabel''', '''article''' and '''label''': Additional parameters for the {{templatelink|categorylink}}.
* '''display''': Whether or not to display the categorylink (case insensitive, defaults to "true")
+
* '''display''': Whether or not to display anything (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).
  
Line 35: Line 45:
  
 
==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 {{templatelink|categorylink}}.
  
 
You may remove the display of the categorylink by specifying any other value than "true" for the '''display''' parameter, so these all have the same result (nothing displayed, but still categorized):
 
You may remove the display of the categorylink by specifying any other value than "true" for the '''display''' parameter, so these all have the same result (nothing displayed, but still categorized):
Line 46: Line 56:
  
 
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.
 
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.
 +
 +
{{stub}}
  
 
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 55: Line 67:
  
 
:[[Quetch]]{{superlink|article=:Category:Quetches|label=list all}}
 
:[[Quetch]]{{superlink|article=:Category:Quetches|label=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 [[Template:Categorylink|Categorylink]] directly is not desired/possible (i.e. when calling this template indirectly).
+
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 {{templatelink|categorylink}} directly is not desired/possible (i.e. when calling this template indirectly).
  
[[Category:System Templates]]
 
[[Category:Categorizers| ]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 21:18, 4 June 2014

Categorizer
Purpose

Infobox [list all]

Single tag

No [list all]

Multi-line

No [list all]

Protected

No [list all]

Game related

No [list all]

Categorization
Suppressible

Yes [list all]

Choice

Single category [list all]

Categories

One: [list all]

  • by parameter category
Variables
Names

One: [list all]

Subpages

This template is used in articles to automatically categorize them under a category, and to display a representation of the category. The display is in the form of a {{categorylink}}. This display may also be turned off to merely categorize an article.

When this is used in an infobox, this will append the categorization to a variable, to allow the infobox to sort its categories. When the display is then turned off, in which case this template would make sure there is no output, the related row may gracefully collapse rather than showing empty.

Parameters

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


Note: The display parameter should only be specified if it's actually used, as it also activates on the empty value.

Syntax

Common use includes these four parameters:

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

Examples

For explanation of the above first four parameters, see {{categorylink}}.

You may remove the display of the categorylink by specifying any other value than "true" for the display parameter, so these all have the same result (nothing displayed, but still categorized):

{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=}}
{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=     }}
{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=false}}
{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=nope}}
{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=yes}}
{{categorizer|category=Quetch characters|catlabel=|article=|label=|display=all}}

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.


  This article is a stub [list all]. You can help the Twinsuniverse by expanding it.

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).