Template:Istrue: Difference between revisions

From HorizonXI Wiki
(Created page with "<includeonly><onlyinclude>{{#switch:{{lc:{{{1|}}}}}|y|yes|true=true|#default=}}</onlyinclude></includeonly> ==Usage== Template that will return "true" if the input is "true", "y" or "yes" ignoring any capitalization. This is supposed to help with mediawiki missing any basic conditional operators that can check for true/false. The main usage is allowing use in conditionals like <nowiki>{{#if:...}}</nowiki>, therefore, if the argument does not evaluate to "true", the temp...")
 
mNo edit summary
 
Line 3: Line 3:
Template that will return "true" if the input is "true", "y" or "yes" ignoring any capitalization. This is supposed to help with mediawiki missing any basic conditional operators that can check for true/false.  
Template that will return "true" if the input is "true", "y" or "yes" ignoring any capitalization. This is supposed to help with mediawiki missing any basic conditional operators that can check for true/false.  
The main usage is allowing use in conditionals like <nowiki>{{#if:...}}</nowiki>, therefore, if the argument does not evaluate to "true", the template will return nothing, which is what the mediawiki function <nowiki>{{#if:...}}</nowiki> recognizes as false.  
The main usage is allowing use in conditionals like <nowiki>{{#if:...}}</nowiki>, therefore, if the argument does not evaluate to "true", the template will return nothing, which is what the mediawiki function <nowiki>{{#if:...}}</nowiki> recognizes as false.  
Also check [[Template:isfalse]] for the corresponding template checking for false.  
<!--Also check [[Template:isfalse]] for the corresponding template checking for false. -->


===Examples===
===Examples===

Latest revision as of 09:03, 28 September 2024

Usage

Template that will return "true" if the input is "true", "y" or "yes" ignoring any capitalization. This is supposed to help with mediawiki missing any basic conditional operators that can check for true/false. The main usage is allowing use in conditionals like {{#if:...}}, therefore, if the argument does not evaluate to "true", the template will return nothing, which is what the mediawiki function {{#if:...}} recognizes as false.

Examples

{{istrue|Yes}}

true

{{#if:{{istrue|Yes}}|do this if true|else do this}}

do this if true

{{istrue|no way}}


{{#if:{{istrue|no way}}|do this if true|else do this}}

else do this