Making code blocks conditional
Dreamweaver lets you develop code blocks that incorporate control statements that execute conditionally. The Server Behavior Builder uses
else statements, and may also contain server behavior parameters. This enables you to insert alternate text blocks based on the values of OR relationships among server behavior parameters. The
else statements appear as shown below. Note that square brackets ([ ]) denote optional code, and the asterisk (*) denotes zero or more instances:
<@ if (
[<@ elseif (
[<@ else @>
<@ endif @>
You can nest any number of conditionals or a loop directive (see Repeating code blocks) within a conditional directive. For example, you can specify that if an expression is true to execute a loop.
New lines after each "@>" are ignored.
This section covers the following topics:
- Effectively using conditional expressions
- Repeating code blocks