Template:එසේය-හෝ-නැත/උපදෙස්
This is a documentation subpage for Template:එසේය-හෝ-නැත. It contains usage information, categories and other content that is not part of the original template page. |
මෙම සැකිල්ල, ලැබෙන විවිධ ආකාර වන ප්රදානය yes/no ආකාරයෙන් ප්රතිදානයක් බවට හරවයි.
භාවිතය
editThe 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).
- result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
{{එසේය-හෝ-නැත|yes}}
- result "" (also applies to "No", "NO", "nO", "N", "n" and "0")
{{එසේය-හෝ-නැත|no}}
- result ""
{{එසේය-හෝ-නැත}}
- result ""
{{එසේය-හෝ-නැත|¬}}
- result "yes" (also applies to any other value not given above).
{{එසේය-හෝ-නැත|purplemonkeydishwasher}}
Each of these can be over-ridden.
- result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
{{එසේය-හෝ-නැත|yes|yes=bacon}}
- result "ham": (also applies to "No", "NO", "nO", "N", "n" and "0")
{{එසේය-හෝ-නැත|no|no=ham}}
- result "eggs"
{{එසේය-හෝ-නැත||blank=eggs}}
- but result "ham"
{{එසේය-හෝ-නැත||no=ham}}
- and result "eggs"
{{එසේය-හෝ-නැත||blank=eggs|no=ham}}
- but
- result "sausage"
{{එසේය-හෝ-නැත|¬|¬=sausage}}
- result "cup-of-tea" (also applies to any other value not given above).
{{එසේය-හෝ-නැත|purplemonkeydishwasher|def=cup-of-tea}}
- but result "bacon"
{{එසේය-හෝ-නැත|purplemonkeydishwasher|yes=bacon}}
- but result "cup-of-tea"
{{එසේය-හෝ-නැත|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}}
- but
This may be used (apparently perversely) thus:
- result "no"
{{එසේය-හෝ-නැත|yes|yes=no|no=yes}}
- result "yes"
{{එසේය-හෝ-නැත|no|yes=no|no=yes}}
This creates a logical inversion.
Full parameter list
editUnnamed 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.
{{එසේය-හෝ-නැත | | yes = | no = | blank= | ¬ = | def = }}
Overview of {{එසේය-හෝ-නැත}} logical values and their associated texts
| ||||||
---|---|---|---|---|---|---|
Input parameter 1 ( )
|
In code | Logical return value | Default return text |
Return text when set:
|
Note | |
yes, y, 1* |
|
|
"yes" | "Pos" | * Case-insensitive (Y=y) | |
Some Text |
|
|
"yes" | "Def" | "Pos" when
| |
no, n, 0* |
|
|
"" | "Neg" | * Case-insensitive (N=n) | |
<blank> |
|
|
"" | "Blank" | "Neg" when
| |
1=<blank> |
|
|
"" | "Blank" | "Neg" when
| |
¬ |
|
|
"" | "Undefined" | ||
<omitted> |
|
|
"" | "Undefined" |
This template normalises an input to be a yes/no output.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Value | 1 | The value to be evaluated | String | required |
Output on yes | yes | Defines a value to output on yes | String | optional |
Output on no | no | Defines a value to output on no | String | optional |
Output on blank input | blank | Defines a value to output if blank input | String | optional |
Output on ¬ | ¬ | Defines a value to output on ¬ | String | optional |
Definite output | def | Defines the output when value = yes | String | optional |