Template:Yesno/doc: Difference between revisions
en>Rebulka No edit summary |
m (1 revision imported) |
(No difference)
|
Latest revision as of 02:59, 10 November 2023
This is a documentation subpage for Template:Yesno. It contains usage information, categories and other content that is not part of the original Template page. |
[[Category:Template documentation pages{{#translation:}}]]
This template normalises an input to be a yes/no output.
Usage
The template has five possible outputs depending on the default parameter (input if you will).
In its simplest usage, these will all be either "yes" or "" (blank = nothing no characters).
- Template:((Yesno|yesTemplate:)) → "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- Template:((Yesno|noTemplate:)) → "" (also applies to "No", "NO", "nO", "N", "n" and "0")
- Template:((YesnoTemplate:)) → ""
- Template:((Yesno|¬Template:)) → ""
- Template:((Yesno|purplemonkeydishwasherTemplate:)) → "yes" (also applies to any other value not given above)
Each of these can be over-ridden.
- Template:((Yesno|yes|yes=baconTemplate:)) → "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- Template:((Yesno|no|no=hamTemplate:)) → "ham" (also applies to "No", "NO", "nO", "N", "n" and "0")
- Template:((Yesno|blank=eggsTemplate:)) → "eggs"
- but Template:((Yesno|no=hamTemplate:)) → "ham"
- and Template:((Yesno|blank=eggs|no=hamTemplate:)) → "eggs"
- Template:((Yesno|¬|¬=sausage|blank=eggs|no=hamTemplate:)) → "sausage"
- and Template:((Yesno|¬=sausage|blank=eggs|no=hamTemplate:)) → "sausage"
- Template:((Yesno|purplemonkeydishwasher|def=cup-of-teaTemplate:)) → "Template:((Yesno|purplemonkeydishwasher|def=cup-of-teaTemplate:))" (also applies to any other value not given above)
- but Template:((Yesno|purplemonkeydishwasher|yes=baconTemplate:)) → "bacon"
- and Template:((Yesno|purplemonkeydishwasher|def=cup-of-tea|yes=baconTemplate:)) → "cup-of-tea"
This may be used (apparently perversely) thus:
- Template:((Yesno|yes|yes=no|no=yesTemplate:)) → "no"
- Template:((Yesno|no|yes=no|no=yesTemplate:)) → "yes"
This creates a logical inversion.
TemplateData
TemplateData for Yesno
This template normalises an input to be a yes or nil output.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Input value | 1 | The value to be evaluated. | String | required |
Output on yes | yes | Specifies the output of the template when the input value is a case-insensitive forms of 'Yes', 'Y', 'True' or '1'. | String | optional |
Output on no | no | Specifies the output of the template when the input value is a case-insensitive forms of 'No', 'N', 'False', or '0'. | String | optional |
Output on blank input | blank | Specifies the output of the template when the input value is defined but is either empty or contains nothing but whitespace character(s). | String | optional |
Output on ¬ | ¬ | Specifies the output of the template when the input value is either '¬' or entirely missing (undefined). | String | optional |
Definite output | def | Specifies the output of the template when the input value is defined but not a form of 'yes', 'no', '1', '0', '¬' or blank. | String | optional |
See also