Building Conditional Blocks With the %ifvar% Tag
The %ifvar% tag is similar to an “if…then…else” expression in other programming languages. You use it to denote a block of code that is to be executed only when a specified variable exists or contains a value that you specify.
The basic format of the %ifvar% tag is as follows, where variableName specifies the name of the variable that will be evaluated at run time:
%ifvar variableName%
Block of Code
[%else%
Block of Code]
%end%
Example
.
.
.
<!--Check for presence of backordered items in the order -->
<!--and display if they exist -->
%ifvar backItems%
<p>Backordered Items
%loop backItems%
%value%<BR>
%endloop%
%endifvar%
.
.
.