Difference between revisions of "Template:Categorizer"

From Twinsuniverse
Jump to: navigation, search
Line 1: Line 1:
<includeonly>
+
<includeonly>{{
{{#if: {{{article|}}} | {{#if: {{{label|}}} | [[{{{article}}}|{{{label}}}]] | [[{{{article}}}]] }} | {{#if: {{{label|}}} | {{{label}}} | ???[[Category:Malformed categorizers]] }} }} {{#if: {{{category|}}} | <sup>&#91;{{#if: {{{catlabel|}}} | [[:Category:{{{category}}}|{{{catlabel}}}]] | [[:Category:{{{category}}}|list all]] }}&#93;</sup> {{#ifeq: {{lc:{{{nocat|false}}}}} | false | [[Category:{{{category}}}]]}} }}
+
#ifeq: {{{article|}}} |
</includeonly><noinclude>
+
|{{
 +
    #if: {{{label|}}}
 +
    | {{{label}}}
 +
    | ''missing article'' {{#ifeq: {{lc:{{SUBJECTSPACE}}}} | template | [[Category:Categorizers missing an article]] }} }}
 +
|{{
 +
    #if: {{{label|}}}
 +
    | [[{{{article}}}|{{{label}}}]]
 +
    | [[{{{article}}}]] }} }} {{
 +
#if: {{{category|}}}
 +
| {{superlink|article=:Category:{{{category}}}|label={{{catlabel|list all}}} }}
 +
  {{#ifeq: {{lc: {{{nocat|false}}} }} | false | [[Category:{{{category}}}]] }}
 +
| {{superlink|label=missing category}} {{#ifeq: {{lc:{{SUBJECTSPACE}}}} | template | [[Category:Categorizers missing a category]] }}
 +
}}</includeonly><noinclude>
 
This template is used to add a tag to an infobox, labeling and automatically categorize the article under a category.
 
This template is used to add a tag to an infobox, labeling and automatically categorize the article under a category.
  
:<nowiki>{{categorizer</nowiki> | category = ''category name'' | catlabel = ''link text for categorylink'' | article = ''an article about the category'' | label = ''link text for article link'' }}
+
:<nowiki>{{categorizer</nowiki> | category = ''category name'' | catlabel = ''displayed text on categorylink'' | article = ''an article about the category'' | label = ''displayed text on articlelink'' }}
  
 
==Parameters==
 
==Parameters==

Revision as of 21:43, 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 parameters

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

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

Optional parameters

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

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

All parameters

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