Short Description

creates conditional ISML code

Table of Contents

Product Version


Product To Version



1 Introduction

The <ISIF> tag group allows you to create conditional ISML code. <ISIF>, and its supporting tags, <ISELSEIF> and <ISELSE> , will likely be the tags you use most in your templates. These are also called business flow functions because they control the business logic's flow.

Every <ISIF> tag must have a matching </ISIF> tag. <ISIF> uses operators to compare values. For more information about operators, see Reference - ISML Operators. To perform more complex comparisons, you can combine conditions within parentheses using logical operators. You can compare any values accessible through variables, as well as numerical and string constants.

The <ISELSE> and <ISELSEIF> tags are optional. You may use as many <ISELSEIF> tags as needed in an <ISIF> statement, but you can only use one <ISELSE>, which must always be the last comparison performed.

2 Syntax

<isif condition = "{ISML expression}">
... some HTML and ISML code ...
<iselseif condition = "{ISML expression}">
... some HTML and ISML code ...
... some HTML and ISML code ...

3 Example

The example shows some possible conditional entries in a template (with and without using operators):

<isif condition="#hasLoopElements(Basket:ProductLineItems)#">
<isif condition="#isDefined(Error_PasswordConfirmation)#">
<isif condition="#Error_PasswordConfirmation EQ 'MandatoryValueNotAvailable'#">
<isif condition="#(isdefined(ERROR_FormValues)) OR (isdefined(ERROR_User))#">
<isif condition="#(isdefined(ERROR_FormValues) AND isdefined(ConfirmMail)) OR…

This example shows how to alternate the colors of the rows in a table. The current color is stored in the user-defined variable, color.

<ISSET name="color" value="#'#00FFFF'#">
    <ISLOOP iterator="basket:product">
      <td bgcolor="#color#">
        <ISPRINT value = "#product:name#">
    <ISIF condition="#color EQ '#00FFFF'#">
      <ISSET name="color" value="#'#00CCFF'#">
      <ISELSEIF condition="#color EQ '#00CCFF'#">
      <ISSET name="color" value="#'#0099FF'#">
      <ISSET name="color" value="#'#00FFFF'#">

The result of a conditional expression must be a Boolean value:

<ISIF condition ="#Products:Price==0#"> Special free gift.
<ISELSEIF condition ="#Products:Price<100#">
Special deal.
Today’s low price.

4 Attributes

4.1 condition

This attribute is required.

condition = Boolean ISML expression

For <ISIF> and <ISELSEIF>, specify an expression that must evaluate to a Boolean value. If the expression evaluates to true, the enclosed code is executed, otherwise it is not. <ISELSE> has no attributes.

Reference - ISML Tags


The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets