Difference between revisions of "Template:Infobox Character/magical"
J McKalling (Talk | contribs) |
J McKalling (Talk | contribs) |
||
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}}}}} |
− | + | ||
| #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 | + | * Whether or not magical (no parameter name and value is case insensitive): |
*# ''no'' | *# ''no'' | ||
− | + | *# any other (non)empty value defaults to: ''yes'' | |
− | *# any other non | + | |
* '''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== | ||
− | + | 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}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
:{{categorizer|category=Nonmagical Characters|label=No|nocat=true}} | :{{categorizer|category=Nonmagical Characters|label=No|nocat=true}} | ||
− | + | 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> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
<nowiki>{{magical|}}</nowiki> | <nowiki>{{magical|}}</nowiki> | ||
− | + | <nowiki>{{magical|yes}}</nowiki> | |
− | + | <nowiki>{{magical|aye, it's magic!}}</nowiki> | |
− | + | <nowiki>{{magical|whatever}}</nowiki> | |
− | + | <nowiki>{{magical|nope?}}</nowiki> | |
− | + | ||
− | <nowiki>{{magical| | + | |
:{{categorizer|category=Magical Characters|label=Yes|nocat=true}} | :{{categorizer|category=Magical Characters|label=Yes|nocat=true}} | ||
− | The | + | 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):
- no
- 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}}
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.