Jump to content

Template:Yesno/doc

From Wikihoc

{{#ifeq:Template:Yesno/doc|Template:Yesno|Lua error in Module:Effective_protection_level at line 64: attempt to index field 'ext' (a nil value).

|

}}

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

|

        }}{{#if:|
         |{{#ifexist:Template:Yesno
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  | 
                 }}
        }}
    | 
   }}

{{Yesno}} (or {{YesNo}}) evaluates any input and produces a normalized yes or nil output, 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, on, and 1; e.g. {{Yesno|yEs|yes=foo}}} → {{safesubst:#switch: yes
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = foo
|#default = foo

}}

  1. No: Case-insensitive forms of No, n, false, off, and 0; e.g. {{Yesno|off|no=bar}}} → {{safesubst:#switch: off
|no
|n
|f
|false
|off
|0        = bar
|         = bar
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}

  1. Blank: When the input is defined but either contains no value or consists of whitespace character only; i.e. {{Yesno||blank=bax}} or {{Yesno| |blank=qux}}} → {{safesubst:#switch:
|no
|n
|f
|false
|off
|0        = 
|         = bax
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}} and {{safesubst:#switch:

|no
|n
|f
|false
|off
|0        = 
|         = qux
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}

  1. Negation: When the input is either ¬ (alt code 170) or entirely missing; i.e. {{Yesno|¬|¬=lorem}}} or {{Yesno|¬=ipsum}} → {{safesubst:#switch: ¬
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = lorem
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}} and {{safesubst:#switch: ¬

|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = ipsum
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}

  1. Anything else: e.g. {{Yesno|foo bar lorem ipsum|def=foo bar lorem ipsum}} → {{safesubst:#switch: foo bar lorem ipsum
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = foo bar lorem ipsum

}}

By default, the template returns "yes" in the 1st and 5th case but returns nil (blank, empty string) in the other cases (case 2, 3 and 4).

Two short-hand templates for the most common uses that override the default behavior:

  • {{yesno-yes}} or {{YesNo-Yes}} – always returns "yes" (or the specified replacement result in |{{SAFESUBST:#if:yes|yes=}}) unless an explicit negative value is given (case 4); i.e., it evaluates to "yes" even when the value is empty or missing (cases 2 and 3).
  • {{yesno-no}} or {{YesNo-No}} – always returns "no" (or the specified replacement result in |{{SAFESUBST:#if:no|no=}}) unless an explicit positive value is given (case 1); 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:
    • {{yesno|y|yes=Yeah}} results in "{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = Yeah
|#default = Yeah

}}"

    • {{yesno|y|yes=bacon}} results in "{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = bacon
|#default = bacon

}}"

  1. No: Template returns the contents of |{{SAFESUBST:#if:no|no=}}, otherwise returns blank. For example:
    • {{yesno|n|no=Nay}} results in "{{safesubst:#switch: n
|no
|n
|f
|false
|off
|0        = Nay
|         = Nay
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}"

    • {{yesno|n|no=ham}} results in "{{safesubst:#switch: n
|no
|n
|f
|false
|off
|0        = ham
|         = ham
|¬        = 
|yes
|y
|t
|true
|on
|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.
    • {{yesno|blank=eggs}} results in "{{safesubst:#switch:
|no
|n
|f
|false
|off
|0        = 
|         = eggs
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}"

    • {{yesno|no=ham}} results in "{{safesubst:#switch:
|no
|n
|f
|false
|off
|0        = ham
|         = ham
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}"

    • {{yesno|blank=eggs|no=ham}} results in "{{safesubst:#switch:
|no
|n
|f
|false
|off
|0        = ham
|         = eggs
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}"

  1. Negation: Template returns the contents of |{{SAFESUBST:#if:¬|¬=}}, otherwise returns blank. For example:
    • {{yesno|¬|¬=sausage}} results in "{{safesubst:#switch: ¬
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = sausage
|yes
|y
|t
|true
|on
|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".
    • {{yesno|purple monkey dish washer|def=cup of tea}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = cup of tea

}}"

    • {{yesno|purple monkey dish washer|yes=bacon}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = bacon
|#default = bacon

}}"

    • {{yesno|purple monkey dish washer|def=cup of tea|yes=bacon}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = bacon
|#default = cup of tea

}}"

For the named parameters, use of a blank value is not the same as omitting the parameter. A blank named parameter tells the template that the customized return value is blank. For example:

  • {{yesno|purple monkey dish washer}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}"

  • {{yesno|purple monkey dish washer|def=}} results in "{{safesubst:#switch: purple monkey dish washer
|no
|n
|f
|false
|off
|0        = 
|         = 
|¬        = 
|yes
|y
|t
|true
|on
|1        = yes
|#default = 

}}" [blank]

Logical distinctions

Overview of {{yesno}} logical values and their associated texts
Input
parameter 1
(<syntaxhighlight lang="text" class="" style="" inline="1">1=</syntaxhighlight>)
In code Logical return value Default
return text
Return text when set:
<syntaxhighlight lang="text" class="" style="" inline="1">yes=Pos</syntaxhighlight>
<syntaxhighlight lang="text" class="" style="" inline="1">no=Neg</syntaxhighlight>
<syntaxhighlight lang="text" class="" style="" inline="1">blank=Blank</syntaxhighlight>
<syntaxhighlight lang="text" class="" style="" inline="1">¬=Undefined</syntaxhighlight>
<syntaxhighlight lang="text" class="" style="" inline="1">def=Def</syntaxhighlight>
Note
yes, y, true, 1* <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno|yes}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">yes by definition</syntaxhighlight> "{{safesubst:#switch: yes no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: yes no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

* Case-insensitive (Y=y)
Some Text <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno|Some Text}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">yes by default</syntaxhighlight> "{{safesubst:#switch: some text no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: some text no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

"{{safesubst:#switch: some text no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Pos

}}" when def=[omitted]

no, n, false, 0* <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno|no}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">no by definition</syntaxhighlight> "{{safesubst:#switch: no no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: no no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

* Case-insensitive (N=n)
[blank] <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno|}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">blank</syntaxhighlight> "{{safesubst:#switch: no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

"{{safesubst:#switch: no n f false off 0 = Neg = Neg ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}" when blank=[omitted]

1=[blank] <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno|1=}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">blank</syntaxhighlight> "{{safesubst:#switch: no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

"{{safesubst:#switch: no n f false off 0 = Neg = Neg ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}" when blank=[omitted]

¬ <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno|¬}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">¬</syntaxhighlight> "{{safesubst:#switch: ¬ no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: ¬ no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

[omitted] <syntaxhighlight lang="text" class="" style="" inline="1">{{yesno}}</syntaxhighlight> <syntaxhighlight lang="text" class="" style="" inline="1">¬</syntaxhighlight> "{{safesubst:#switch: ¬ no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: ¬ no n f false off 0 = Neg = Blank ¬ = Undefined yes y t true on 1 = Pos #default = Def

}}"

Comparison with related templates
Input parameter 1 (<syntaxhighlight lang="text" class="" style="" inline="1">1=</syntaxhighlight>) {{yesno}} {{yesno-yes}} {{yesno-no}}
yes, y, true, 1* "{{safesubst:#switch: yes no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: yes no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: yes no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

Some Text "{{safesubst:#switch: some text no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: some text no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: some text no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

no, n, false, 0* "{{safesubst:#switch: no no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: no no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: no no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

[blank] "{{safesubst:#switch: no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

1=[blank] "{{safesubst:#switch: no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

¬ "{{safesubst:#switch: ¬ no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: ¬ no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: ¬ no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

[omitted] "{{safesubst:#switch: ¬ no n f false off 0 = = ¬ = yes y t true on 1 = yes #default = yes

}}" [blank]

"{{safesubst:#switch: {{{1}}} no n f false off 0 = no = yes ¬ = yes yes y t true on 1 = yes #default = yes

}}"

"{{safesubst:#switch: {{{1}}} no n f false off 0 = no = no ¬ = no yes y t true on 1 = yes #default = no

}}"

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. <syntaxhighlight lang="wikitext" style="overflow: auto"> {{safesubst:#switch: input value

|no
|n
|f
|false
|off
|0        = Output on no
|         = Output on blank input
|¬        = Output on ¬
|yes
|y
|t
|true
|on
|1        = Output on yes
|#default = Definite output

}} </syntaxhighlight>

See also

  • {{#ifexpr:(0=0) and ({{#ifeq:X{{#ifeq:AC | <#salted#>

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}|X0000 |0 |1}}) |Error using {{unichar}}: Input "AC" is not a hexadecimal value.

| {{{{#ifeq:|y|sans-serif|mono}}|{{#switch:<#salted#>

| <#salted#>=U+ | =U+ | #default=[[<#salted#>|U+]]}}{{#ifeq:AC | <#salted#> | <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}}} {{#if:|Template:Substr}}{{#if: | [[File:|frameless|{{#if: | {{#if:|{{{size}}}|10px}} | {{#if:{{{cwith}}}|125%|150%}} }}|baseline|alt={{#if: | Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}]] | {{#switch:{{#if:0|{{#ifexpr: 0<=65535|{{#ifexpr: (00<=0) and (0<=31) or (127<=0) and (0<=159)| Cc | {{#ifexpr: (55296<=0) and (0<=57343)| Cs | {{#ifexpr: ((57344<=0) and (0<=63743))| Cp | {{#ifexpr: (64976<=0 and 0<=65007) or 0=65534 or 0=65535| Cn | {{#ifexpr: (0=173) or (0=1807) or (0=6068) or (0=6069) or (8203<=0 and 0<=8207) or (8234<=0 and 0<=8238) or (8288<=0 and 0<=8292) or (8298<=0 and 0<=8303) or (0=65279) or (65529<=0 and 0<=65531)| Cf | {{#ifexpr: (1536<=0 and 0<=1539) or (0=1757)| Cf (visible)| {{#ifexpr: 0=32 or 0=160 or 0=5760 or 0=6158 or 0=8239 or 0=8287 or 0=8288 or 0=12288 or (8192<=0 and 0<=8205)| Zs | {{#ifexpr: 0=8232| Zl | {{#ifexpr: 0=8233| Zp | }} }} }} }} }} }} }} }} }}|{{#switch: } }}| FFFE | FFFF = Cn | {{#ifexpr: ((983040<=0) and (0<=1114111))| Cp | {{#ifexpr: 0>=1114112 | <#not a Unicode code point#>| {{#ifexpr: (0=69821) or (119155<=0 and 0<=119162) or (0=917505) or (917536<=0 and 0<=917631)| Cf | }} }} }} }} }}|<#not a Unicode code point#> }}

| <#not a Unicode code point#> =<not-a-Unicode-code-point-{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}>

| Cc =<control-{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}>

| Cs =<surrogate-{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}>

| Cp =<private-use-{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}>

| Cn =<noncharacter-{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}>

| Cf | Zl | Zp =
| Zs ={{#ifeq:{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}| 0020 | |&#x{{#ifeq:AC | <#salted#> | <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}};}}

| #default={{#switch:unicode
  | ipa   =Template:IPA
  | lang  =[{{#if: | {{{cwith}}} | {{#if:{{{cwith}}} || ◌ }} }}&#x{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}};] Error: {{Lang}}: missing language tag (help)

  | script=Template:Script
  | unicode 
  | #default = {{#ifeq:{{#if: | {{{cwith}}} | {{#if:{{{cwith}}} || ◌ }} }}|◌|Template:Script|{{#if: | {{{cwith}}} | {{#if:{{{cwith}}} || ◌ }} }}&#x{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}; }}}}}}{{#ifeq:{{#if: | {{{cwith}}} | {{#if:{{{cwith}}} || ◌ }} }}| | }}}}{{#if:|Template:Substr}} {{#ifeq:| none || {{#switch:{{#if:0|{{#ifexpr: 0<=65535|{{#ifexpr: (00<=0) and (0<=31) or (127<=0) and (0<=159)| Cc | {{#ifexpr: (55296<=0) and (0<=57343)| Cs | {{#ifexpr: ((57344<=0) and (0<=63743))| Cp | {{#ifexpr: (64976<=0 and 0<=65007) or 0=65534 or 0=65535| Cn | {{#ifexpr: (0=173) or (0=1807) or (0=6068) or (0=6069) or (8203<=0 and 0<=8207) or (8234<=0 and 0<=8238) or (8288<=0 and 0<=8292) or (8298<=0 and 0<=8303) or (0=65279) or (65529<=0 and 0<=65531)| Cf | {{#ifexpr: (1536<=0 and 0<=1539) or (0=1757)| Cf (visible)| {{#ifexpr: 0=32 or 0=160 or 0=5760 or 0=6158 or 0=8239 or 0=8287 or 0=8288 or 0=12288 or (8192<=0 and 0<=8205)| Zs | {{#ifexpr: 0=8232| Zl | {{#ifexpr: 0=8233| Zp | }} }} }} }} }} }} }} }} }}|{{#switch: } }}| FFFE | FFFF = Cn | {{#ifexpr: ((983040<=0) and (0<=1114111))| Cp | {{#ifexpr: 0>=1114112 | <#not a Unicode code point#>| {{#ifexpr: (0=69821) or (119155<=0 and 0<=119162) or (0=917505) or (917536<=0 and 0<=917631)| Cf | }} }} }} }} }}|<#not a Unicode code point#> }} | Zl | Zp | Zs={{#ifeq:<#salted#> | <#salted#> |{{#if: | Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}| {{#if: <#salted#> | [[<#salted#>|{{#if: | Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}]] |[[{{#ifeq:{{#ifeq:AC | <#salted#> | <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}|0020|space (punctuation)|{{#if: | script error: no such module "unicode alias". | lua error in module:unicode_data at line 541: parameter 2 is not a code point in hexadecimal base.}}}}|{{#if: | Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}]] }}}} | Cc | Cs | Cp | Cn | <#not a Unicode code point#> = {{#ifeq:<#salted#> | <#salted#> || {{#if: <#salted#> | [[<#salted#>]] | Error using {{unichar}}: Pagename expected in "nlink="}}}} | #default={{#switch:<#salted#>

| <#salted#> ={{#if: |  Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}
| =[[{{#switch:{{#ifeq:AC  | <#salted#> 

| <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}}|0023|002E|003C|003E|005B|005D|007B|007C|007D|200E|200F|202A|202B|202C|202D|202E={{#if: | script error: no such module "unicode alias". | lua error in module:unicode_data at line 541: parameter 2 is not a code point in hexadecimal base.}}|003A=colon (punctuation)|005F=underscore|#default=&#x{{#ifeq:AC | <#salted#> | <#salted#> | {{#switch:acac

   |0x0x
   |u+0x = <#salted#>

}} {{#SWITCH:AC

    | U+
    | 0X = {{SAFESUBST:#IFEXPR: 2 < 0

|AC |{{SAFESUBST:#IFEXPR: 2+1 > 2 | | AC }} }}

    |AC 
    }}

}};}}|{{#if: | Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}]]

| #default =[[<#salted#>|{{#if: |  Script error: No such module "Unicode alias". | Lua error in Module:Unicode_data at line 541: Parameter 2 is not a code point in hexadecimal base.}}]]}}}}}} {{#if:{{#ifeq:{{#ifeq:||yes|no}}|yes||}}

|({{safesubst:#if:1|{{#ifeq:{{#ifeq:{{#ifeq:||yes|no}}|yes||}}|||{{ safesubst:#if: |{{ safesubst:#ifeq:{{{demo}}} |no

|
|

}} |{{ safesubst:#ifeq:Template|Template

|
|

}}}}{{#ifeq:{{#ifeq:||yes|no}}|yes||}}{{#if:|⧼dot-separator⧽}}}}}})}} }}

  • Module:yesno
  • {{Yesno-yes}} – variant of Yesno that defaults to "yes" if value is not explicitly negative
  • {{Yesno-no}} – variant of Yesno that defaults to "no" if value is not explicitly positive

TemplateData

{{#if:|{{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AYesno%7CYesno%7CYesno%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Yesno|Template:Yesno|this template}} in articles{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}}.

|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AYesno%7CYesno%7CYesno%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}}

|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AYesno%7CYesno%7CYesno%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report] for {{#if:Yesno|Template:Yesno|Template:Yesno}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}}.

|#default=[1]{{#ifeq:{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:

|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AYesno%7CYesno%7CYesno%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Yesno|Template:Yesno|this template}} in articles{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}}.

|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AYesno%7CYesno%7CYesno%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}}

|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AYesno%7CYesno%7CYesno%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report] for {{#if:Yesno|Template:Yesno|Template:Yesno}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}}.

|#default=[2]{{#ifeq:{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Yesno|its|this}} TemplateData}} }}}}

TemplateData for Yesno

{{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Template|Template
   | template
   | other
   }}
 }}

| template = {{safesubst:#if:{{safesubst:#ifeq:doc|sandbox|1}}{{safesubst:#ifeq:doc|doc|1}}||

}} | other | #default = }} <templatedata> { "description": "This template normalises an input to be a yes or nil output.", "params": { "1": { "label": "Input value", "description": "The value to be evaluated", "type": "string", "suggested": 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 '¬' (negation) 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>