Template:YesNo

From Structorica Wiki
Revision as of 07:55, 16 January 2026 by Ivan (talk | contribs) (Created page with "<includeonly>{{#switch: {{lc: {{{1|}}}}} | y | yes | t | true | on | 1 = {{{yes|yes}}} | n | no | f | false | off | 0 | = {{{no|}}} |<!--blank--> = {{{blank|{{{no|}}} }}} | #default = {{{yes|yes}}} }}</includeonly><noinclude> === Documentation === == Usage == This template is used to make other templates by turning an input into either "Yes" or no text, so as to be able to accept multiple "true" or "false" inputs for certain functions. It transforms the input valu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation

Usage

This template is used to make other templates by turning an input into either "Yes" or no text, so as to be able to accept multiple "true" or "false" inputs for certain functions. It transforms the input value into either "yes" or no text, as stated above. The following makes it return "yes":

  • 1
  • t
  • true
  • yes
  • y
  • on

The following makes the template return no text:

  • 0
  • f
  • false
  • no
  • n
  • off

The template, as such, makes the following return one output if a true input is provided and another output if a false input is given in a template transclusion:

{{#if:{{YesNo|{{{1}}}}}|first output|second output}}

The same can also be done with {{YesNo|{{{1|}}}|yes=first output|no=second output}}. This is because the true and false values can also be customized in the template to return outputs other than "yes" or no text.