Difference between revisions of "Template:Categorizer"

From Twinsuniverse
Jump to: navigation, search
(Examples)
Line 35: Line 35:
  
 
==Examples==
 
==Examples==
===Common parameters===
+
Common use of the categorizer includes both '''category''' and '''article''' parameters:
  <nowiki>{{categorizer
+
  <nowiki>{{categorizer|category = Quetches|article = Quetch}}</nowiki>
|category = Quetches
+
|article = Quetch
+
}}</nowiki>
+
  
 
:[[Quetch]] <sup>&#91;[[:Category:Quetches|list all]]&#93;</sup>
 
:[[Quetch]] <sup>&#91;[[:Category:Quetches|list all]]&#93;</sup>
 
(and the page would be categorized under [[:Category:Quetches]])
 
(and the page would be categorized under [[:Category:Quetches]])
  
===Optional parameters===
+
 
 +
Both the displayed texts on the category and article links can be customized using the '''catlabel''' and '''label''' parameters respectively:
 
  <nowiki>{{categorizer
 
  <nowiki>{{categorizer
 
  |category = Quetches
 
  |category = Quetches
Line 55: Line 53:
 
(and the page would be categorized under [[:Category:Quetches]])
 
(and the page would be categorized under [[:Category:Quetches]])
  
===All parameters===
+
 
 +
If the '''article''' parameter is left out, the article will not become linked (the '''label''' can still be used):
 +
<nowiki>{{categorizer|category = Quetches|label = Men}}</nowiki>
 +
 
 +
:Men{{superlink|article=:Category:Quetches|label=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:
 +
<nowiki>{{categorizer|category = Quetches}}</nowiki>
 +
 
 +
:''missing article''{{superlink|article=:Category:Quetches|label=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:
 +
<nowiki>{{categorizer
 +
|catlabel = list members
 +
|article = Quetch
 +
|label = Men
 +
}}</nowiki>
 +
 
 +
:[[Quetch|Men]]{{superlink|label=missing category}}
 +
(and the page would '''not''' be categorized automatically, and templates would be categorized under [[:Category:Categorizers missing a category]])
 +
 
 +
 
 +
Full use of all parameters would render the categorizer like this:
 
  <nowiki>{{categorizer
 
  <nowiki>{{categorizer
 
  |category = Quetches
 
  |category = Quetches

Revision as of 21:22, 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 article will not become linked (the label can still be used):

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


Full use of all parameters would render the categorizer like this:

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

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