Šablon:Yesno/dok
{{#ifeq:dok |dok
|
{{#ifeq:show |show
|
| Ovo je dokumentaciona podstranica za Šablon:Yesno. Sadrži informacije o korišćenju, kategorijama i drugom sadržaju koji nije deo originalne stranice. |
}}{{#if: |
| {{#ifexist:Шаблон:Yesno
| [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
|
}}
}}
|
}}
{{#ifeq:Yesno|Yesno|
| Ovaj {{#switch:Šablon|Modul=Lua modul|#default=šablon}} se koristi na {{#if:480+|480+|značajnom broju}} stranica, tako da će promene koje se na njemu izvrše biti široko primećene. Da bi se izbege greške velikih razmera i bespotrebno opterećivanje servera, molimo da bilo kakve promene testirate na podstranicama {{#switch:Šablon|Modul=modula|#default=šablona}} [[{{#switch: dok | doc | sandbox | док | песак = Шаблон:Yesno
| #default = Шаблон:Yesno/док
}}/песак|/песак]] или [[{{#switch: док
| doc | sandbox | док | песак = Шаблон:Yesno
| #default = Шаблон:Yesno/док
}}/тест|/тест]]{{#switch:Шаблон|Модул=.|#default=, или на сопственој корисничкој подстраници.}} Размислите и о постављању расправе о променама које намеравате да унесете на {{#if:|страници [[{{{2}}}]]|[[{{#switch: док
| doc | sandbox | док | песак = Разговор о шаблону:Yesno
| #default = Разговор о шаблону:Yesno/док
}}|stranici za razgovor]]}} pre njihovog primenjivanja. |
}}
{{{{#if: |замени:}}Yesno{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} (or {{{{#if: |замени:}}YesNo{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}) evaluates any input and produces a normalized yes or no, based on the content of the input and several configurable options. It is not used in article prose, but in coding complex templates.
Usage
The template distinguishes five different types of input, supplied on the first unnamed parameter:
- Yes: Case-insensitive forms of
Yes,y,true, and1; e.g.{{{{#if: |замени:}}Yesno{{#if:yEs ||yEs}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} - No: Case-insensitive forms of
No,n,false, and0; e.g.{{{{#if: |замени:}}Yesno{{#if:nO ||nO}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} - Nothing: When the input is defined but either contains no value or consists of whitespace character only; i.e.
{{Yesno|}}or{{{{#if: |замени:}}Yesno{{#if: || }}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} - Negation: When the input is either
¬or entirely missing; i.e.{{{{#if: |замени:}}Yesno{{#if:¬ ||¬}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}or{{{{#if: |замени:}}Yesno{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} - Anything else: e.g.
{{{{#if: |замени:}}Yesno{{#if:Purple monkey dish washer ||Purple monkey dish washer}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}
By default, the template returns "yes" in the first and last case but returns blank in the other cases.
Two short-hand templates for the most common uses that override the default behavior:
{{{{#if: |замени:}}yesno-yes{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} or {{{{#if: |замени:}}YesNo-Yes{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} – always returns "yes" (or the specified replacement result in |{{SAFESUBST:#if:yes|yes=}}) unless an explicit negative value is given; i.e., it evaluates to "yes" even when the value is empty or missing.
{{{{#if: |замени:}}yesno-no{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} or {{{{#if: |замени:}}YesNo-No{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} – always returns "no" (or the specified replacement result in |{{SAFESUBST:#if:no|no=}}) unless an explicit positive value is given; i.e., it evaluates to "no" even when the value is present, as long as it does not contain anything that resolves to "yes".
Customizing the output
Template's default output can be customized with five named parameters, respectively: |{{SAFESUBST:#if:yes|yes=}}, |{{SAFESUBST:#if:no|no=}}, |{{SAFESUBST:#if:blank|blank=}}, |{{SAFESUBST:#if:¬|¬=}} and |{{SAFESUBST:#if:def|def=}}. If these parameters are specified, the template response is as follows:
- Yes: Template returns the contents of
|{{SAFESUBST:#if:yes|yes=}}, otherwise returns "yes". For example:
{{{{#if: |замени:}}yesno{{#if:y ||y}}{{#if:yes=Yeah ||yes=Yeah}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: y
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = Yeah
|#default = Yeah
}}"
{{{{#if: |замени:}}yesno{{#if:y ||y}}{{#if:yes=bacon ||yes=bacon}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: y
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = bacon
|#default = bacon
}}"
- No: Template returns the contents of
|{{SAFESUBST:#if:no|no=}}, otherwise returns blank. For example:
{{{{#if: |замени:}}yesno{{#if:n ||n}}{{#if:no=Nay ||no=Nay}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: n
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 = Nay
| = Nay
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
{{{{#if: |замени:}}yesno{{#if:n ||n}}{{#if:no=ham ||no=ham}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: n
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 = ham
| = ham
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
- Nothing: Template returns the contents of
|{{SAFESUBST:#if:blank|blank=}}, or of |{{SAFESUBST:#if:no|no=}} in absence of the former; otherwise, returns blank.
{{{{#if: |замени:}}yesno{{#if: ||}}{{#if:blank=eggs ||blank=eggs}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch:
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| = eggs
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
{{{{#if: |замени:}}yesno{{#if: ||}}{{#if:no=ham ||no=ham}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch:
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 = ham
| = ham
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
{{{{#if: |замени:}}yesno{{#if: ||}}{{#if:blank=eggs ||blank=eggs}}{{#if:no=ham ||no=ham}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch:
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 = ham
| = eggs
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
- Negation: Template returns the contents of
|{{SAFESUBST:#if:¬|¬=}}, otherwise returns blank. For example:
{{{{#if: |замени:}}yesno{{#if:¬ ||¬}}{{#if:¬=sausage ||¬=sausage}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: ¬
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ = sausage
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
- Anything else: Template returns the contents of
|{{SAFESUBST:#if:def|def=}}, or of |{{SAFESUBST:#if:yes|yes=}} in absence of the former; otherwise, returns "yes".
{{{{#if: |замени:}}yesno{{#if:purple monkey dish washer ||purple monkey dish washer}}{{#if:def=cup of tea ||def=cup of tea}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = cup of tea
}}"
{{{{#if: |замени:}}yesno{{#if:purple monkey dish washer ||purple monkey dish washer}}{{#if:yes=bacon ||yes=bacon}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = bacon
|#default = bacon
}}"
{{{{#if: |замени:}}yesno{{#if:purple monkey dish washer ||purple monkey dish washer}}{{#if:def=cup of tea ||def=cup of tea}}{{#if:yes=bacon ||yes=bacon}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = bacon
|#default = cup of tea
}}"
For the named parameters, use of a blank value is not the same as omitting the parameter. Blank named parameters tells the template that the customized return value is blank. For example:
{{{{#if: |замени:}}yesno{{#if:purple monkey dish washer ||purple monkey dish washer}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default = yes
}}"
{{{{#if: |замени:}}yesno{{#if:purple monkey dish washer ||purple monkey dish washer}}{{#if:def= ||def=}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|false
|не
|н
|нетачно
|ne
|netačno
|0 =
| =
|¬ =
|yes
|y
|true
|да
|д
|тачно
|da
|d
|tačno
|1 = yes
|#default =
}}" [blank]
Logical distinctions
Overview of {{{{#if: |замени:}}yesno{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} logical values and their associated texts
Input
parameter 1
(1=)
In code
Logical return value
Default
return text
Return text when set:
yes=Pos
no=Neg
blank=Blank
¬=Undefined
def=Def
Note
yes, y, true, 1*
{{yesno|yes}}
yes by definition
"{{safesubst:#switch: yes
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}"
"{{safesubst:#switch: yes
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
* Case-insensitive (Y=y)
Some Text
{{yesno|Some Text}}
yes by default
"{{safesubst:#switch: some text
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}"
"{{safesubst:#switch: some text
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
"{{safesubst:#switch: some text
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Pos
}}" when def=[omitted]
no, n, false, 0*
{{yesno|no}}
no by definition
"{{safesubst:#switch: no
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch: no
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
* Case-insensitive (N=n)
[blank]
{{yesno|}}
blank
"{{safesubst:#switch:
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch:
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
"{{safesubst:#switch:
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Neg
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}" when blank=[omitted]
1=[blank]
{{yesno|1=}}
blank
"{{safesubst:#switch:
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch:
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
"{{safesubst:#switch:
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Neg
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}" when blank=[omitted]
¬
{{yesno|¬}}
¬
"{{safesubst:#switch: ¬
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch: ¬
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
[omitted]
{{yesno}}
¬
"{{safesubst:#switch: ¬
no
n
false
ne
n
netačno
ne
netačno
0 =
=
¬ =
yes
y
true
da
d
tačno
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch: ¬
no
n
false
ne
n
netačno
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
da
d
tačno
da
d
tačno
1 = Pos
#default = Def
}}"
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 =
}}
See also
TemplateData
{{#if:|pogledajte mesečni izveštaj o greškama za ovaj šablon.|Ovo je {{#if:|TemplateData|TemplateData}} dokumentacija za ovaj šablon, korišćena u Vizuelnom uređivaču i u drugim alatkama; pogledajte mesečni izveštaj o greškama za ovaj šablon.}}
TemplateData za Yesno
{{#ifeq:dok|sandbox||
}}
<templatedata>
{
"description": "This template normalises an input to be a yes/no output.",
"params": {
"1": {
"label": "Input value",
"description": "The value to be evaluated",
"type": "string",
"required": true
},
"yes": {
"label": "Output on yes",
"description": "Specifies the output of the template when the input value is a case-insensitive forms of 'Yes', 'Y', 'True' or '1'",
"type": "string",
"required": false
},
"no": {
"label": "Output on no",
"description": "Specifies the output of the template when the input value is a case-insensitive forms of 'No', 'N', 'False, or '0'",
"type": "string",
"required": false
},
"blank": {
"label": "Output on blank input",
"description": "Specifies the output of the template when the input value is defined but is either empty or contains nothing but whitespace character(s)",
"type": "string",
"required": false
},
"¬": {
"label": "Output on ¬",
"description": "Specifies the output of the template when the input value is either '¬' or entirely missing (undefined)",
"type": "string",
"required": false
},
"def": {
"label": "Definite output",
"description": "Specifies the output of the template when the input value is defined but not a form of 'yes', 'no', '1', '0', '¬' or blank",
"type": "string",
"required": false
}
}
}
</templatedata>