Come build with us.
Stacks API v6 for Stacks 2.5
%[if true ]% %[else]% %[endif]%
%[if true ]% %[else]% %[endif]%
%[if <expression>]%
content displayed when <expression> is true
%[endif]%
or
%[if <expression>]%
content displayed when <expression> is true
%[else]%
content displayed when <expression> is false
%[endif]%
<expression>
can be integer or boolean property (e.g. %id=checkBoxValue%
) or an expression that evaluates to an integer or boolean (e.g. %( %id=count% < 1 )%
). Note: Integer values are converted to boolean using the C language rules (e.g. 0 => False, all other values => True).
Conditionals allow you to add or remove content to the generated HTML based on the value of the conditional argument.
Conditionals may be nested.
%[if %id=checkbox% ]%
Checkbox is checked.
%[endif]%
.elementClass {
%[if %id=checkbox% ]%
display: block;
%[else]%
display: none;
%[endif]%
}