Template:If
Revision as of 11:34, 18 December 2020 by Kevin Wang (talk | contribs)
Replacement for #if.
Usage:
{{if |test=VARIABLE_OR_PARAMETER_TO_TEST |then=code if 'test' is not empty |else=code if 'test' is empty }}
Parameter else is optional.
Examples:
ex 1: {{if|test=x|then=true|else=false}} - x is not null, so return true ex 2: {{if|test= |then=true|else=false}} - x is null, so return false ex 3: {{if|test= |then=true}} - x is null and no else is defined, so don't return anything
ex 1: true
ex 2: false
ex 3: