Difference between revisions of "Template:Infobox Template/choice"

From Twinsuniverse
Jump to: navigation, search
m
(added infobox)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{#ifeq: {{{ignore|}}}||{{
 
<includeonly>{{#ifeq: {{{ignore|}}}||{{
 
#switch: {{lc:{{{1|}}}}}
 
#switch: {{lc:{{{1|}}}}}
| single = {{categorizer|category=Single-choice templates|label=Single value|nocat={{{nocat|false}}}}}
+
| none = {{categorizer|category=Nonchoice templates|label=No choice|nocat={{{nocat|false}}}}}
| multiple = {{categorizer|category=Multiple-choice templates|label=Multiple values|nocat={{{nocat|false}}}}}
+
| single = {{categorizer|category=Single-choice templates|label=Single category|nocat={{{nocat|false}}}}}
| none = {{categorizer|category=Nonchoice templates|label=None|nocat={{{nocat|false}}}}}
+
| multiple = {{categorizer|category=Multiple-choice templates|label=Multiple categories|nocat={{{nocat|false}}}}}
 
| {{maintenance task|nocat={{{nocat|false}}}
 
| {{maintenance task|nocat={{{nocat|false}}}
 
     |category=Templates of unknown choice
 
     |category=Templates of unknown choice
Line 9: Line 9:
 
     |label=''unknown''
 
     |label=''unknown''
 
     |reason=The '''choice''' parameter specifies {{#if:{{{1|}}}|'{{lc:{{{1|}}}}}' (unknown)| no value}} }}
 
     |reason=The '''choice''' parameter specifies {{#if:{{{1|}}}|'{{lc:{{{1|}}}}}' (unknown)| no value}} }}
}}|{{categorizer|category=Nonchoice templates|display=none|nocat={{{nocat|false}}}}}}}</includeonly><noinclude>
+
}}|{{categorizer|category=Nonchoice templates|display=none|nocat={{{nocat|false}}}}}}}</includeonly><noinclude>{{Infobox Template
 +
|purpose=infobox
 +
|singletag=no
 +
|multiline=no
 +
|gamerelated=no
 +
|suppressible=recursively
 +
|choice=single
 +
|cat1=Nonchoice templates!none
 +
|cat2=Single-choice templates!single
 +
|cat3=Multiple-choice templates!multiple
 +
|cat4=Templates of unknown choice!''unknown''!maintenance
 +
|var1=
 +
}}
 +
 
 
This template offers a way to specify whether another template accepts one single or multiple choices, from a selection of values. This only applies to categorization of the pages the template is used on. It can also automatically categorize the template page under the category for that type of choice.
 
This template offers a way to specify whether another template accepts one single or multiple choices, from a selection of values. This only applies to categorization of the pages the template is used on. It can also automatically categorize the template page under the category for that type of choice.
  
Line 32: Line 45:
 
  <nowiki>{{Infobox Template/choice|multiple}}</nowiki>
 
  <nowiki>{{Infobox Template/choice|multiple}}</nowiki>
  
:{{categorizer|category=Single-choice templates|label=Single value|nocat=true}}
+
:{{categorizer|category=Single-choice templates|label=Single category|nocat=true}}
:{{categorizer|category=Multiple-choice templates|label=Multiple values|nocat=true}}
+
:{{categorizer|category=Multiple-choice templates|label=Multiple categories|nocat=true}}
  
  
Line 39: Line 52:
 
  <nowiki>{{Infobox Template/choice|MULtipLE}}</nowiki>
 
  <nowiki>{{Infobox Template/choice|MULtipLE}}</nowiki>
  
:{{categorizer|category=Multiple-choice templates|label=Multiple values|nocat=true}}
+
:{{categorizer|category=Multiple-choice templates|label=Multiple categories|nocat=true}}
  
  
Line 45: Line 58:
 
  <nowiki>{{Infobox Template/choice|none}}</nowiki>
 
  <nowiki>{{Infobox Template/choice|none}}</nowiki>
  
:{{categorizer|category=Nonchoice templates|label=None|nocat=true}}
+
:{{categorizer|category=Nonchoice templates|label=No choice|nocat=true}}
  
  
Line 72: Line 85:
 
This would render the same result as the first example above, but would not automatically categorize under [[:Category:Single-choice templates]]. This feature works both on valid values and the maintenance task mentioned above.
 
This would render the same result as the first example above, but would not automatically categorize under [[:Category:Single-choice templates]]. This feature works both on valid values and the maintenance task mentioned above.
  
[[Category:Categorizers|template]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 17:48, 6 June 2014

Infobox Template/choice
Purpose

Infobox [list all]

Single tag

No [list all]

Multi-line

No [list all]

Protected

No [list all]

Game related

No [list all]

Categorization
Suppressible

Recursively [list all]

Choice

Single category [list all]

Categories

Multiple: [list all]

Variables
Names

none [list all]

Subpages

This template offers a way to specify whether another template accepts one single or multiple choices, from a selection of values. This only applies to categorization of the pages the template is used on. It can also automatically categorize the template page under the category for that type of choice.


Note: "multiple choice" means here the ability to select multiple values from the set of available ones, not that there are multiple values available (as all cases have that).

Parameters

  1. The type of choice the template accepts (no parameter name and value is case insensitive):
    • single
    • multiple
    • none
    • any other (non)empty value defaults to: unknown
  • ignore: Whether or not to ignore the choice, if there is no categorization (any value will do, defaults to not ignore)
  • nocat: Whether or not to suppress categorization under the selected category (defaults to false, which means auto categorization).

Syntax

{{Infobox Template/choice|value}}

Examples

Common use includes the unnamed parameter with either values "single" or "multiple":

{{Infobox Template/choice|single}}
{{Infobox Template/choice|multiple}}
Single category [list all]
Multiple categories [list all]


The case of the value is not important:

{{Infobox Template/choice|MULtipLE}}
Multiple categories [list all]


You don't have to specify "choice" for templates that don't offer one during categorization, by specifying the "none" value:

{{Infobox Template/choice|none}}
No choice [list all]


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

{{Infobox Template/choice}}
{{Infobox Template/choice|}}
{{Infobox Template/choice|yeah}}
{{Infobox Template/choice|true}}
{{Infobox Template/choice|inevitable}}
{{Infobox Template/choice|there is no spoon}}
{{Infobox Template/choice|7}}
{{Infobox Template/choice|C}}
unknown [list all]


Lastly, it is possible to ignore "choice" altogether, if the template does not categorize anyway, by using the ignore parameter, which would not display but categorize under Category:Nonchoice templates by default:

{{Infobox Template/choice|ignore=true}}
{{Infobox Template/choice||ignore=true}}
{{Infobox Template/choice|I don't know|ignore=yessss}}


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

{{Infobox Template/choice|single|nocat=true}}

This would render the same result as the first example above, but would not automatically categorize under Category:Single-choice templates. This feature works both on valid values and the maintenance task mentioned above.