Skip to Main Content
Adobe® Dreamweaver® CS4 Bible
book

Adobe® Dreamweaver® CS4 Bible

by Joseph Lowery
March 2009
Beginner to intermediate content levelBeginner to intermediate
1321 pages
46h 24m
English
Wiley
Content preview from Adobe® Dreamweaver® CS4 Bible
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Adobe® Dreamweaver® CS5 Bible

Adobe® Dreamweaver® CS5 Bible

Joseph W. Lowery
Dreamweaver® CS3 Bible

Dreamweaver® CS3 Bible

Joseph W. Lowery

Publisher Resources

ISBN: 9780470382523Purchase book