Operation Manual

570
USING DREAMWEAVER
Making pages dynamic
Last updated 3/28/2012
About custom server behaviors” on page 565
Creating code blocks” on page 567
Testing server behaviors” on page 575
Position a code block (general instructions)
1 Using the Server Behavior Builder, write a code block.
2 In the Server Behavior Builder dialog box, select a position in which to insert the code block from the Insert Code
pop-up menu.
3 In the Server Behavior Builder dialog box, select a position relative to that which you selected in the Insert Code
pop-up menu.
4 If you complete the authoring of the code block, click OK.
The server behavior is listed in the Server Behaviors panel (Window > Server Behavior); click the Plus (+) button to
view the server behavior.
5 Test the server behavior and ensure that it functions properly.
Position a code block relative to another tag on the page
1 In the Insert Code pop-up menu, select Relative To A Specific Tag.
2 In the Tag box, enter the tag or select one from the pop-up menu.
If you enter a tag, don’t include the angled brackets (<>).
3 Specify a location relative to the tag by choosing an option in the Relative Position pop-up menu.
Position a code block relative to a tag selected by the page designer
1 In the Insert Code pop-up menu, select Relative To The Selection.
2 Specify a location relative to the selection by choosing an option in the Relative Position pop-up menu.
You can insert your code block just before or just after the selection. You can also replace the selection with your code
block, or you can wrap the code block around the selection.
To wrap the code block around a selection, the selection must consist of an opening and closing tag with nothing in
between, as follows:
<CFIF Day="Monday"></CFIF>
Insert the opening tag piece of the code block before the selection’s opening tag and the closing tag piece of the code
block after the selection’s closing tag.
Repeating code blocks with the loop directive
To repeat a portion of a code block or the entire code block a number of times, use the following syntax:
<@ loop (@@param1@@,@@param2@@) @>code block<@ endloop @>
When creating server behaviors, you can use looping constructs to repeat a code block a specified number of times.
<@ loop (@@param1@@,@@param2@@,@@param3@@,@@param_n@@) @>code block
<@ endloop @>