Шаблон:Yesno
{{#switch: ¬
|no |n |false |не |н |нетачно |ne |netačno |0 = | = |¬ = |yes |y |true |да |д |тачно |da |d |tačno |1 = yes |#default = yes
}}
{{#ifeq:yesno |док
|
{{#ifeq:show |show
|| Ово је документациона подстраница за Шаблон:Yesno. Садржи информације о коришћењу, категоријама и другом садржају који није део оригиналне странице. |
}}{{#if: |
| {{#ifexist:Шаблон:Yesno
| [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
|
}}
}}
|
}}
{{#ifeq:Yesno|Yesno|| Овај {{#switch:Шаблон|Модул=Луа модул|#default=шаблон}} се користи на {{#if:480+|480+|значајном броју}} страница, тако да ће промене које се на њему изврше бити широко примећене. Да би се избеге грешке великих размера и беспотребно оптерећивање сервера, молимо да било какве промене тестирате на подстраницама {{#switch:Шаблон|Модул=модула|#default=шаблона}} [[{{#switch: Yesno | doc | sandbox | док | песак = Шаблон:Yesno
| #default = Шаблон:Yesno
}}/песак|/песак]] или [[{{#switch: Yesno
| doc | sandbox | док | песак = Шаблон:Yesno
| #default = Шаблон:Yesno
}}/тест|/тест]]{{#switch:Шаблон|Модул=.|#default=, или на сопственој корисничкој подстраници.}} Размислите и о постављању расправе о променама које намеравате да унесете на {{#if:|страници [[{{{2}}}]]|[[{{#switch: Yesno
| doc | sandbox | док | песак = Разговор о шаблону:Yesno
| #default = Разговор о шаблону:Yesno
}}|страници за разговор]]}} пре њиховог примењивања. |
{{{{#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
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}"
"{{safesubst:#switch: yes
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
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
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}"
"{{safesubst:#switch: some text
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}"
"{{safesubst:#switch: some text
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
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
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch: no
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}"
* Case-insensitive (N=n)
[blank]
{{yesno|}}
blank
"{{safesubst:#switch:
no
n
false
не
н
нетачно
ne
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch:
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}"
"{{safesubst:#switch:
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Neg
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}" when blank=[omitted]
1=[blank]
{{yesno|1=}}
blank
"{{safesubst:#switch:
no
n
false
не
н
нетачно
ne
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch:
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}"
"{{safesubst:#switch:
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Neg
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}" when blank=[omitted]
¬
{{yesno|¬}}
¬
"{{safesubst:#switch: ¬
no
n
false
не
н
нетачно
ne
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch: ¬
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
da
d
tačno
1 = Pos
#default = Def
}}"
[omitted]
{{yesno}}
¬
"{{safesubst:#switch: ¬
no
n
false
не
н
нетачно
ne
netačno
0 =
=
¬ =
yes
y
true
да
д
тачно
da
d
tačno
1 = yes
#default = yes
}}" [blank]
"{{safesubst:#switch: ¬
no
n
false
не
н
нетачно
ne
netačno
0 = Neg
= Blank
¬ = Undefined
yes
y
true
да
д
тачно
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:|погледајте месечни извештај о грешкама за овај шаблон.|Ово је {{#if:|TemplateData|TemplateData}} документација за овај шаблон, коришћена у Визуелном уређивачу и у другим алаткама; погледајте месечни извештај о грешкама за овај шаблон.}}
TemplateData за Yesno
{{#ifeq:Yesno|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>
{{#ifeq:Yesno|sandbox | |
}}