
979
Using Dreamweaver Templates
28
B; but if C is true, show D—and if neither of them is true, show E”? With the help of multiple-if
expressions, you bet it can.
With a multiple-if template expression, you can test for any number of conditions and act accord-
ingly. Multiple-if expressions use two different template expressions: one to close the entire expres-
sion and another one for each separate case. Here is an example:
<!-- TemplateBeginMultipleIf -->
<!-- checks value of template parameter SKU and shows the desired image-->
<!-- TemplateBeginIfClause cond = “SKU == 101”>
<img src = “/images/ring101.tif” width=”125” height=”125”>
<!-- TemplateEndIfClause-->
<!-- TemplateBeginIfClause cond = “SKU == 102”>
<img src = “/images/bracelet102.gif” width=”125” height=”125”>
<!-- TemplateEndIfClause-->
<!-- TemplateBeginIfClause cond = “SKU == 103”>
<img src = “/images/necklace103.gif” width=”125” height=”125”>
<!-- TemplateEndIfClause-->
//default display if none of the other conditions are met
<!-- TemplateBeginIfClause cond = “SKU != 103”>
<img src = “/images/spacer.gif” width=”125” height=”125”>
<!-- TemplateEndIfClause-->
<!-- TemplateEndMultipleIf -->
In this code, if none of the conditions are met, a blank spacer image is displayed. As with other tem-
plate expressions, multiple-if expressions must be coded by hand.
Template expression examples
Template expressions obviously have a g ...