Difference between revisions of "Template:Categorizer"

From Twinsuniverse
Jump to: navigation, search
(Examples)
m (Examples)
Line 38: Line 38:
 
  <nowiki>{{categorizer|category = Quetches|article = Quetch}}</nowiki>
 
  <nowiki>{{categorizer|category = Quetches|article = Quetch}}</nowiki>
  
:[[Quetch]] <sup>&#91;[[:Category:Quetches|list all]]&#93;</sup>
+
:[[Quetch]]{{superlink|article=:Category:Quetches|label=list all}}
 
(and the page would be categorized under [[:Category:Quetches]])
 
(and the page would be categorized under [[:Category:Quetches]])
  
Line 50: Line 50:
 
}}</nowiki>
 
}}</nowiki>
  
:[[Quetch|Men]] <sup>&#91;[[:Category:Quetches|list members]]&#93;</sup>
+
:[[Quetch|Men]]{{superlink|article=:Category:Quetches|label=list members}}
 
(and the page would be categorized under [[:Category:Quetches]])
 
(and the page would be categorized under [[:Category:Quetches]])
  
  
If the '''article''' parameter is left out, the article will not become linked (the '''label''' can still be used):
+
If the '''article''' parameter is left out, the categorizer won't render a link on the '''label''':
 
  <nowiki>{{categorizer|category = Quetches|label = Men}}</nowiki>
 
  <nowiki>{{categorizer|category = Quetches|label = Men}}</nowiki>
  
Line 79: Line 79:
  
  
Full use of all parameters would render the categorizer like this:
+
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do):
  <nowiki>{{categorizer
+
  <nowiki>{{categorizer|category = Quetches|article = Quetch|nocat = true}}</nowiki>
|category = Quetches
+
|catlabel = list members
+
|article = Quetch
+
|label = Men
+
|nocat = true
+
}}</nowiki>
+
  
:[[Quetch|Men]] <sup>&#91;[[:Category:Quetches|list members]]&#93;</sup>
+
:[[Quetch]]{{superlink|article=:Category:Quetches|label=list all}}
 
(and the page would '''not''' be categorized under [[:Category:Quetches]])
 
(and the page would '''not''' be categorized under [[:Category:Quetches]])
  
 
[[Category:Twinsuniverse - Templates]]</noinclude>
 
[[Category:Twinsuniverse - Templates]]</noinclude>

Revision as of 21:57, 11 November 2012

This template is used to add a tag to an infobox, labeling and automatically categorize the article under a category.

{{categorizer | category = category name | catlabel = displayed text on categorylink | article = an article about the category | label = displayed text on articlelink }}

Parameters

  • category: The target category to add this article to.
  • catlabel: The text to display on the categorylink (defaults to "list all").
  • article: The article that represents the target category (defaults to the label not to become linked).
  • label: The text to display on the link to the article (defaults to the article pagename).
  • nocat: Whether or not to suppress categorization under category (defaults to false, which means auto categorization).

Syntax

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

Examples

Common use of the categorizer includes both category and article parameters:

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

(and the page would be categorized under Category:Quetches)


Both the displayed texts on the category and article links can be customized using the catlabel and label parameters respectively:

{{categorizer
 |category = Quetches
 |catlabel = list members
 |article = Quetch
 |label = Men
}}
Men [list members]

(and the page would be categorized under Category:Quetches)


If the article parameter is left out, the categorizer won't render a link on the label:

{{categorizer|category = Quetches|label = Men}}
Men [list all]

(and the page would be categorized under Category:Quetches)


If both the article and label parameters are left out, the categorizer will render error text like this:

{{categorizer|category = Quetches}}
missing article [list all]

(and the page would be categorized under Category:Quetches, and templates would be categorized under Category:Categorizers missing an article)


If the category parameter is left out, regardless of parameter catlabel, the categorizer will render like this:

{{categorizer
 |catlabel = list members
 |article = Quetch
 |label = Men
}}
Men [missing category]

(and the page would not be categorized automatically, and templates would be categorized under Category:Categorizers missing a category)


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]

(and the page would not be categorized under Category:Quetches)