Template:Boolean: Difference between revisions
imported>Ttv pedro270707 (Created page with "<includeonly>{{#ifeq: {{{1|}}} | 1 | y | {{#ifeq: {{{1|}}} | true | y | {{#ifeq: {{{1|}}} | y | y | n }} }} }}</includeonly><noinclude> {{Documentation}} <!-- Put categories on the documentation page --> </noinclude>") |
imported>Ttv pedro270707 mNo edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#ifeq: {{{1|}}} | 1 | y | {{#ifeq: {{{1|}}} | true | y | {{#ifeq: {{{1|}}} | y | y | n }} }} }}</includeonly><noinclude> | <includeonly>{{#vardefine:string|{{#ifeq: {{{string|}}} | 1 | {{{1|}}} | {{#ifeq: {{{string|}}} | true | {{{1|}}} | {{#ifeq: {{{1|}}} | yes | {{{1|}}} | {{#ifeq: {{{string|}}} | y | {{{1|}}} | n }} }} }} }}}}<!-- | ||
-->{{#ifeq: {{{1|}}} | 1 | y | {{#ifeq: {{{1|}}} | true | y | {{#ifeq: {{{1|}}} | yes | y | {{#ifeq: {{{1|}}} | y | y | {{#ifeq: {{{1|}}} | 0 | n | {{#ifeq: {{{1|}}} | false | n | {{#ifeq: {{{1|}}} | no | n | {{#ifeq: {{{1|}}} | n | n | {{#var:string}} }} }} }} }} }} }} }} }}</includeonly><noinclude> | |||
{{Documentation}} | {{Documentation}} | ||
<!-- Put categories on the documentation page --> | <!-- Put categories on the documentation page --> | ||
</noinclude> | </noinclude> |
Latest revision as of 19:37, 19 March 2023
[view | | | ]Documentation
This template parses a boolean value. It should generally be used in other templates.
Arguments[edit source]
Argument | Note |
---|---|
1 |
The passed boolean. |
string |
Sets if the original string should be returned if the passed value is not any of the accepted booleans. Returns n if a string is passed and this is set to a false value (or unset).
|
Usage[edit source]
This template takes 1
, true
, yes
and y
and parses them into y
, and any other strings into n
. The parsed values are regularly used in this wiki.
Code | Output |
---|---|
{{boolean|1}} |
y |
{{boolean|true}} |
y |
{{boolean|yes}} |
y |
{{boolean|y}} |
y |
{{boolean|0}} |
n |
{{boolean|false}} |
n |
{{boolean|no}} |
n |
{{boolean|n}} |
n |
{{boolean|This is not a boolean}} |
n |
{{boolean|This is not a boolean|string=y}} |
This is not a boolean |
{{boolean|true|string=y}} |
y |
[view | | | ]The above documentation is transcluded from Template:Boolean/doc.