The Multiple If condition in template code

The Multiple If condition in template code

You can define template expressions for if and multiple-if conditions (see Template expressions). This example demonstrates defining a parameter named "Dept", setting an initial value, and defining a Multiple If condition which determines which logo to display.

The following is an example of the code you might enter in the head section of the template:

<!-- TemplateParam name="Dept" type="number" value="1" -->

The following condition statement checks the value assigned to the Dept parameter. When the condition is true or matches, the appropriate image is displayed.

<!-- TemplateBeginMultipleIf -->
<!-- checks value of Dept and shows appropriate image-->


<!-- TemplateBeginClause cond="Dept == 1" --> <img src=".../sales.gif"> <!-- TemplateEndIfClause -->
<!-- TemplateBeginIfClause cond="Dept == 2" --> <img src=".../support.gif"> <!-- TemplateEndIfClause-->
<!-- TemplateBeginIfClause cond="Dept == 3" --> <img src=".../hr.gif"> <!-- TemplateEndIfClause -->
<!-- TemplateBeginIfClause cond="Dept != 3" --> <img src=".../spacer.gif"> <!-- TemplateEndIfClause -->
<!-- TemplateEndMultipleIf -->

When you create a template-based document, the template parameters are automatically passed to it. The template user determines which image to display (see Modifying template properties).



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Laying Out Pages with CSS
Managing Templates
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly
 
ASPTreeView.com
 
Evaluation has УУНРґexpired.
Info...