Template:Yesno/doc
This template evaluates any input and produces a normalized yes or nil output, based on the content of the input and several configurable options. It is not meant for use directly in articles, but for making templates.
In a nutshell[edit source]
If the input the template receives is (not case sensitive) "no", "n", "false", "off", "0", is only whitespace, or is entirely missing; then the template returns an empty string. If any other value is received, then the template returns "yes".
This is useful for creating opt-in parameters in templates. For example, a nocat parameter:
{{#if: {{yesno| {{{nocat|}}} }} ||[[Category:Your category here]]}}
In this example, the template adds the page to the category, but if the user does not want that then they can set the parameter nocat=yes
, nocat=y
, etc.
This is a basic use case for this template. What the template outputs can be changed. For more complex usage, read Wikipedia's documentation.
TemplateData[edit source]
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 |