Editing
Template:Yesno/doc
Jump to navigation
Jump to search
⚠️
Warning:
You are not logged in.
Your IP address will be publicly visible
if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username instead of your IP, along with other benefits.
Anti-spam check. Do
not
fill this in!
This template evaluates any input and produces a normalized <samp>yes</samp> or nil output, based on the content of the input and several configurable options. It is not meant for use directly in articles, but for making templates. == In a nutshell == If the input the template receives is (not case sensitive) "no", "n", "false", "off", "0", is only whitespace, or is entirely missing; then the template returns an empty string. If any other value is received, then the template returns "yes". This is useful for creating opt-in parameters in templates. For example, a nocat parameter: <code><nowiki>{{#if: {{yesno| {{{nocat|}}} }} ||[[Category:Your category here]]}}</nowiki></code> In this example, the template adds the page to the category, but if the user does not want that then they can set the parameter <code>nocat=yes</code>, <code>nocat=y</code>, etc. This is a basic use case for this template. What the template outputs can be changed. For more complex usage, read [[wp:Template:Yesno|Wikipedia's documentation]]. == TemplateData == <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", "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>
Summary:
Please note that all contributions to Irony Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Irony Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit source
View history
More
Purge cache
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information
Page values