DREAMWEAVER CS3
User Guide
591
Note:
When entering code in the Code Block box, you can only insert a single tag or code block for each named code
block (for example,
myBehavior_block1
,
myBehavior_block2
,
myBehavior_blockn
, etc.). If you have to enter
multiple tags or code blocks, create an individual code block for each one. You can also copy and paste code from other
pages.
7
Place the insertion point in the code block where you’d like to insert the parameter, or select a string to replace
with a parameter.
8
Click the Insert Parameters in Code Block button.
9
Enter a name for the parameter in the Parameter Name box (for example,
Session
), and click OK.
The parameter is inserted into the code block at the location where you placed the insertion point prior to defining
the parameter. If you selected a string, every instance of the selected string in the code block is replaced with a
parameter marker (for example,
@@Session@@
).
10
Select an option from the Insert Code pop-up menu specifying where to embed the code blocks.
11
(Optional) To specify additional information about the server behavior, click the Advanced button.
12
To create more code blocks, repeat steps 5 through 11.
13
If the server behavior requires that parameters be supplied to it, you must create a dialog box that accepts param-
eters from the person applying the behavior. See the link below.
14
After you perform the required steps to create the server behavior, click OK.
The Server Behaviors panel lists the server behavior.
15
Test the server behavior and ensure that it functions properly.
See also
“Repeating code blocks with the loop directive” on page 595
“Coding guidelines” on page 599
“Request a parameter for the server behavior” on page 597
“Adding custom server behaviors” on page 589
Advanced options
After you specify the source code and insert location for each code block, the server behavior is completely defined.
In most cases, you don’t need to specify any additional information.
If you are an advanced user, you can set any of the following options:
Identifier
Specifies whether the code block should be treated as an identifier.
By default, every code block is an identifier. If Dreamweaver finds an identifier code block anywhere in a document,
it lists the behavior in the Server Behaviors panel. Use the Identifier option to specify whether the code block should
be treated as an identifier.
At least one of the server behavior’s code blocks must be an identifier. A code block should not be an identifier if one
of the following conditions applies: the same code block is used by some other server behavior; or the code block is
so simple that it might occur naturally on the page.
Server Behavior Title
Specifies the title of the behavior in the Server Behaviors panel.
September 4, 2007