Difference between revisions of "Template:Infobox Character/magical"

From Twinsuniverse
Jump to: navigation, search
m (Examples)
Line 2: Line 2:
 
{{#switch: {{lc:{{{1|no}}}}}
 
{{#switch: {{lc:{{{1|no}}}}}
 
| no = {{categorizer|category=Nonmagical Characters|label=No|nocat={{{nocat|false}}}}}
 
| no = {{categorizer|category=Nonmagical Characters|label=No|nocat={{{nocat|false}}}}}
| #default = {{categorizer|category=Magical Characters|label=Yes|nocat={{{nocat|false}}}}}
+
| yes = {{categorizer|category=Magical Characters|label=Yes|nocat={{{nocat|false}}}}}
 +
| {{categorizer|category=Characters of unknown magic|label=unknown|nocat={{{nocat|false}}}}}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 
This template offers the choice to define the magical category of a (character) article. It can also automatically categorize a page under that category.
 
This template offers the choice to define the magical category of a (character) article. It can also automatically categorize a page under that category.
Line 9: Line 10:
 
* Whether or not magical (no parameter name and value is case insensitive):
 
* Whether or not magical (no parameter name and value is case insensitive):
 
*# ''no''
 
*# ''no''
*# any other (non)empty value defaults to: ''yes''
+
*# ''yes''
 +
*# any other (non)empty value defaults to: ''unknown''
 
* '''nocat''': Whether or not to suppress categorization under the chosen category (defaults to false, which means auto categorization).
 
* '''nocat''': Whether or not to suppress categorization under the chosen category (defaults to false, which means auto categorization).
  
  
'''''Note:''' the parameter is optional, it is only really needed to be able to specify the negative value.''
+
'''''Note:''' eventhough the name of this template does suggest a default value of "yes", leaving the parameter empty or out resolves to "unknown" instead.''
  
 
==Syntax==
 
==Syntax==
Line 27: Line 29:
  
  
It doesn't matter which value you use, any value other than "no" will express a ''positive'' value, even if you leave it out altogether, so these all have the same result:
+
The case of the value is not important:
 +
<nowiki>{{magical|YES}}</nowiki>
 +
 
 +
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}}
 +
 
 +
 
 +
You may leave "magical" undefined (which would raise the [[:Category:Characters of unknown magic|Characters of unknown magic]] maintenance task) by not specifying any valid value, so these all have the same result:
 
  <nowiki>{{magical}}</nowiki>
 
  <nowiki>{{magical}}</nowiki>
 
  <nowiki>{{magical|}}</nowiki>
 
  <nowiki>{{magical|}}</nowiki>
 
  <nowiki>{{magical|yes}}</nowiki>
 
  <nowiki>{{magical|yes}}</nowiki>
 +
<nowiki>{{magical|true}}</nowiki>
 
  <nowiki>{{magical|aye, it's magic!}}</nowiki>
 
  <nowiki>{{magical|aye, it's magic!}}</nowiki>
 
  <nowiki>{{magical|whatever}}</nowiki>
 
  <nowiki>{{magical|whatever}}</nowiki>
Line 40: Line 49:
 
  <nowiki>{{magical|not}}</nowiki>
 
  <nowiki>{{magical|not}}</nowiki>
  
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}}
+
:{{categorizer|category=Characters of unknown magic|label=unknown|nocat=true}}
 
+
 
+
The only way to express a ''negative'' value is by specifying "no" (case insensitive), so these both have the same result:
+
<nowiki>{{magical|no}}</nowiki>
+
<nowiki>{{magical|NO}}</nowiki>
+
 
+
:{{categorizer|category=Nonmagical Characters|label=No|nocat=true}}
+
  
  

Revision as of 01:38, 25 November 2012

This template offers the choice to define the magical category of a (character) article. It can also automatically categorize a page under that category.

Parameters

  • Whether or not magical (no parameter name and value is case insensitive):
    1. no
    2. yes
    3. any other (non)empty value defaults to: unknown
  • nocat: Whether or not to suppress categorization under the chosen category (defaults to false, which means auto categorization).


Note: eventhough the name of this template does suggest a default value of "yes", leaving the parameter empty or out resolves to "unknown" instead.

Syntax

{{magical|value}}

Examples

Common use includes the only parameter with either values "yes" or "no":

{{magical|yes}}
{{magical|no}}
Yes [list all]
No [list all]


The case of the value is not important:

{{magical|YES}}
Yes [list all]


You may leave "magical" undefined (which would raise the Characters of unknown magic maintenance task) by not specifying any valid value, so these all have the same result:

{{magical}}
{{magical|}}
{{magical|yes}}
{{magical|true}}
{{magical|aye, it's magic!}}
{{magical|whatever}}
{{magical|nope?}}
{{magical|false}}
{{magical|null}}
{{magical|zero}}
{{magical|powerless}}
{{magical|not}}
unknown [list all]


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

{{magical|yes|nocat=true}}

This would render the same result as the first example above, but would not automatically categorize under Category:Magical Characters. This feature works on all valid values.