ਫਰਮਾ:Yesno
This template normalises an input to be a yes/no output.
Usage
[ਸੋਧੋ]The template discerns five possible logical outputs depending on the first parameter (input if you will).
In its simplest usage these will all be either "yes" or "" (blank — nothing no characters).
{{yesno|yes}}result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1"){{yesno|no}}result "" (also applies to "No", "NO", "nO", "N", "n" and "0"){{yesno}}result ""{{yesno|¬}}result ""{{yesno|purplemonkeydishwasher}}result "yes" (also applies to any other value not given above).
Each of these can be over-ridden.
{{yesno|yes|yes=bacon}}result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1"){{yesno|no|no=ham}}result "ham": (also applies to "No", "NO", "nO", "N", "n" and "0"){{yesno||blank=eggs}}result "eggs"- but
{{yesno||no=ham}}result "ham" - and
{{yesno||blank=eggs|no=ham}}result "eggs"
- but
{{yesno|¬|¬=sausage}}result "sausage"{{yesno|purplemonkeydishwasher|def=cup-of-tea}}result "cup-of-tea" (also applies to any other value not given above).- but
{{yesno|purplemonkeydishwasher|yes=bacon}}result "bacon" - but
{{yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}}result "cup-of-tea"
- but
This may be used (apparently perversely) thus:
{{yesno|yes|yes=no|no=yes}}result "no"{{yesno|no|yes=no|no=yes}}result "yes"
This creates a logical inversion.
Full parameter list
[ਸੋਧੋ]Unnamed parameter 1= the input value to be evaluated. The other parameters (all named, all optional), are the return values for their respective logical outcome. When set, each one overrules their default return value.
{{yesno
|
| yes =
| no =
| blank=
| ¬ =
| def =
}}
Overview of {{yesno}} logical values and their associated texts
| ||||||
|---|---|---|---|---|---|---|
| Input parameter 1 ( 1=)
|
In code | Logical return value | Default return text |
Return text when set:yes=Posno=Negblank=Blank¬=Undefineddef=Def
|
Note | |
| yes, y, 1* | {{yesno|yes}}
|
yes by definition
|
"yes" | "Pos" | * Case-insensitive (Y=y) | |
| Some Text | {{yesno|Some Text}}
|
yes by default
|
"yes" | "Def" | "Pos" when def=<omitted>
| |
| no, n, 0* | {{yesno|no}}
|
no by definition
|
"" | "Neg" | * Case-insensitive (N=n) | |
| <blank> | {{yesno|}}
|
blank
|
"" | "Blank" | "Neg" when blank=<omitted>
| |
| 1=<blank> | {{yesno|1=}}
|
blank
|
"" | "Blank" | "Neg" when blank=<omitted>
| |
| ¬ | {{yesno|¬}}
|
¬
|
"" | "Undefined" | ||
| <omitted> | {{yesno}}
|
¬
|
"" | "Undefined" | ||
This template normalises an input to be a yes/no output.
| ਮਾਪਦੰਡ | ਵੇਰਵਾ | ਕਿਸਮ | ਦਰਜਾ | |
|---|---|---|---|---|
| Value | 1 | The value to be evaluated | ਸਤਰ | ਲੋੜੀਂਦਾ ਏ |
| Output on yes | yes | Defines a value to output on yes | ਸਤਰ | ਚੋਣਵਾਂ |
| Output on no | no | Defines a value to output on no | ਸਤਰ | ਚੋਣਵਾਂ |
| Output on blank input | blank | Defines a value to output if blank input | ਸਤਰ | ਚੋਣਵਾਂ |
| Output on ¬ | ¬ | Defines a value to output on ¬ | ਸਤਰ | ਚੋਣਵਾਂ |
| Definite output | def | Defines the output when value = yes | ਸਤਰ | ਚੋਣਵਾਂ |