Pređi na sadržaj

Šablon:Yesno/dok

Izvor: Vojna Enciklopedija

{{#ifeq:dok |dok

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Шаблон:Yesno
                  | [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
                  | 
                 }}
        }}
    | 
   }}

{{#ifeq:Yesno|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:

  1. Yes: Case-insensitive forms of Yes, y, true, and 1; 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: ||...}}}}
  2. No: Case-insensitive forms of No, n, false, and 0; 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: ||...}}}}
  3. 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: ||...}}}}
  4. 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: ||...}}}}
  5. 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:

  1. 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

}}"

  1. 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

}}"

  1. 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

}}"

  1. 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

}}"

  1. 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>