Template:Istrue

From HorizonXI Wiki
Revision as of 09:00, 28 September 2024 by Aramachus (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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. Also check Template:isfalse for the corresponding template checking for 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