Template:Yesno/doc
From Survivalistsresource
m (count) |
m (1 revision) |
Current revision as of 09:00, 12 August 2011
{{#ifeq: yesno/doc | doc
|
{{
#ifeq: show | show | {{ {{#switch: {{#if: | | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = ambox | talk = tmbox | user = ombox | wikipedia = ombox | file | image = imbox | mediawiki = ombox | template = ombox | help = ombox | category = cmbox | portal = ombox | book = ombox | other | #default = ombox
}}
| type = notice
| image = File:Edit-copy green.svg
| imageright =
| style =
| textstyle =
| text = This is a documentation subpage for Template:Yesno/doc.
It contains usage information, categories, interlanguage links and other content that is not part of the original {{ #if: | {{{text2}}} | {{ #if: | {{{text1}}} | {{ #ifeq: Template | User | template template page | {{ #if: Template |template page|article}}}}}}}}.
| small =
| smallimage =
| smallimageright =
| smalltext =
}}
}}{{ #if: | | [[Category:{{ #if: Template | Template | Article }} documentation {{#ifeq:Template|Template|pages}}]] }}
| }} {{#ifeq:|yes
|| |
{{#if:{{#if:| {{{smallimage}}} | }} | {{#if:| {{{smallimage}}} | }} | [[Image:{{#switch:content | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:yes|yes | 30x30px | 40x40px }}|link=|alt=]]}} |
}}
{{#if:| {{{smalltext}}} | This template is used on {{#if: 4,000,000+ | 4,000,000+ |a very large number of}} pages. To avoid large-scale disruption and unnecessary server load, any changes should first be tested in this template's [[{{#ifeq:Yesno/doc|doc| Template:Yesno/doc | Template:Yesno/doc }}/sandbox|/sandbox]] or [[{{#ifeq:Yesno/doc|doc| Template:Yesno/doc | Template:Yesno/doc }}/testcases|/testcases]] subpage, or in your own user space. The tested changes can then be added in one single edit to this template. Please consider discussing any changes on {{#if:|[[{{{2}}}]]|the [[{{#ifeq:Yesno/doc|doc| Template talk:Yesno/doc | Template talk:Yesno/doc }}|talk page]]}} before implementing them. }} |
{{#if: | {{{smallimageright}}} | }} |
| | speedy | delete | content | style | move | protection | notice =
| #default =}}
|| |
{{#if: | | [[Image:{{#switch:content | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} |
}}
This template is used on {{#if: 4,000,000+ | 4,000,000+ |a very large number of}} pages. To avoid large-scale disruption and unnecessary server load, any changes should first be tested in this template's [[{{#ifeq:Yesno/doc|doc| Template:Yesno/doc | Template:Yesno/doc }}/sandbox|/sandbox]] or [[{{#ifeq:Yesno/doc|doc| Template:Yesno/doc | Template:Yesno/doc }}/testcases|/testcases]] subpage, or in your own user space. The tested changes can then be added in one single edit to this template. Please consider discussing any changes on {{#if:|[[{{{2}}}]]|the [[{{#ifeq:Yesno/doc|doc| Template talk:Yesno/doc | Template talk:Yesno/doc }}|talk page]]}} before implementing them. |
| | speedy | delete | content | style | move | protection | notice =
| #default =}} }}
This template normalises an input to be a yes/no output.
[edit] Usage
The template has five possible outputs depending on the default parameter (input if you will).
In its simplest usage these will all be either "yes" or "" (blank - nothing no characters).
- {{yesno|yes}} result "yes" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- {{yesno|no}} result "" (also applies to "No", "NO", "nO", "N", "n" and "0")
- {{yesno}} result ""
- {{yesno|¬}} result ""
- {{yesno|purplemonkeydishwasher}} result "yes" (also applies to any other value not given above).
Each of these can be over-ridden.
- {{yesno|yes|yes=bacon}} result "bacon" (also applies to "Yes", "YeS", etc, "Y", "y" and "1")
- {{yesno|no|no=ham}} result "ham" (also applies to "No", "NO", "nO", "N", "n" and "0")
- {{yesno|blank= eggs}} result "eggs"
- but {{yesno|no=ham}} result "ham"
- and {{yesno|blank= eggs|no=ham}} result "eggs"
- {{yesno|¬|¬=sausage}} result "sausage"
- {{yesno|purplemonkeydishwasher|def=cup-of-tea}} result "cup-of-tea" (also applies to any other value not given above).
- but {{yesno|purplemonkeydishwasher|yes=bacon}} result "bacon"
- but {{yesno|purplemonkeydishwasher|def=cup-of-tea|yes=bacon}} result "cup-of-tea"
This may be used (apparently perversely) thus:
- {{yesno|yes|yes=no|no=yes}} result "no"
- {{yesno|no|yes=no|no=yes}} result "yes"
This creates a logical inversion.