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

From Twinsuniverse
Jump to: navigation, search
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
 
{{#switch: {{lc:{{{1|no}}}}}
 
{{#switch: {{lc:{{{1|no}}}}}
| no
+
| no = {{categorizer|category=Nonmagical Characters|label=No|nocat={{{nocat|false}}}}}
| = {{categorizer|category=Nonmagical Characters|label=No|nocat={{{nocat|false}}}}}
+
 
| #default = {{categorizer|category=Magical Characters|label=Yes|nocat={{{nocat|false}}}}}
 
| #default = {{categorizer|category=Magical Characters|label=Yes|nocat={{{nocat|false}}}}}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
Line 8: Line 7:
  
 
==Parameters==
 
==Parameters==
* Whether or not magical (no parameter name and values are case insensitive):
+
* Whether or not magical (no parameter name and value is case insensitive):
 
*# ''no''
 
*# ''no''
*# leaving the value out and the empty value defaults to: ''no''
+
*# any other (non)empty value defaults to: ''yes''
*# any other non-empty value defaults to: ''yes''
+
 
* '''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.''
  
 
==Syntax==
 
==Syntax==
Line 18: Line 19:
  
 
==Examples==
 
==Examples==
The template may be used like this:
+
Common use includes the only parameter with either values "yes" or "no":
 
  <nowiki>{{magical|yes}}</nowiki>
 
  <nowiki>{{magical|yes}}</nowiki>
 +
<nowiki>{{magical|no}}</nowiki>
  
 
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}}
 
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}}
 
 
Or this:
 
<nowiki>{{magical|no}}</nowiki>
 
 
 
:{{categorizer|category=Nonmagical Characters|label=No|nocat=true}}
 
:{{categorizer|category=Nonmagical Characters|label=No|nocat=true}}
  
  
You may even leave out the argument, which will default to no like this:
+
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:
 
  <nowiki>{{magical}}</nowiki>
 
  <nowiki>{{magical}}</nowiki>
 
:{{categorizer|category=Nonmagical Characters|label=No|nocat=true}}
 
 
 
Using the empty value is the same:
 
 
  <nowiki>{{magical|}}</nowiki>
 
  <nowiki>{{magical|}}</nowiki>
 
+
<nowiki>{{magical|yes}}</nowiki>
:{{categorizer|category=Nonmagical Characters|label=No|nocat=true}}
+
<nowiki>{{magical|aye, it's magic!}}</nowiki>
 
+
<nowiki>{{magical|whatever}}</nowiki>
 
+
  <nowiki>{{magical|nope?}}</nowiki>
Specifying any other value will be interpreted as yes like this:
+
  <nowiki>{{magical|of cource}}</nowiki>
+
  
 
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}}
 
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}}
  
  
The case of the value is not important:
+
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>
 
  <nowiki>{{magical|NO}}</nowiki>
  

Revision as of 21:16, 24 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. any other (non)empty value defaults to: yes
  • 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.

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]


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:

{{magical}}
{{magical|}}
{{magical|yes}}
{{magical|aye, it's magic!}}
{{magical|whatever}}
{{magical|nope?}}
Yes [list all]


The only way to express a negative value is by specifying "no" (case insensitive), so these both have the same result:

{{magical|no}}
{{magical|NO}}
No [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.