Harvest festival 2024.png

Dare to try out the Harvest Festival 2024!?

Template:Istrue

From HorizonXI Wiki
Revision as of 09:03, 28 September 2024 by Aramachus (talk | contribs)
(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.

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