beautypg.com

Edit and modify server behaviors coding guidelines, Edit and modify server behaviors, Coding guidelines – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 553

background image

To the top

To the top

want to include spaces in the label, you can edit the generated HTML file.

Create a dialog box for your server behavior to request the parameter value

1. In the Server Behavior Builder, click Next.

2. To change the display order of the dialog box controls, select a parameter and click the up and down arrows.

3. To change a parameter’s control, select the parameter and select another control in the Display As column.

4. Click OK.

Dreamweaver generates a dialog box with a labeled control for each designer-supplied parameter that you defined.

View the dialog box

Click the Plus (+) button in the Server Behaviors panel (Window > Server Behaviors), and select your custom server behavior from the pop-up

menu.

Edit the dialog box you created for the server behavior

1. In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button, and select Edit Server Behaviors from the pop-up

menu.

2. Select your server behavior from the list, and click Open.

3. Click Next.

A dialog box appears listing all the designer-supplied parameters that you defined in your code.

4. To change the display order of the dialog box controls, select a parameter and click the up and down arrows.

5. To change a parameter’s control, select the parameter and select another control in the Display As column.

6. Click OK.

Edit and modify server behaviors

You can edit any server behavior created with the Server Behavior Builder, including server behaviors you download from the Dreamweaver
Exchange website, and other third-party developers.

If you apply a server behavior to a page and then edit the behavior in Dreamweaver, instances of the old behavior no longer appear in the Server
Behaviors panel. The Server Behaviors panel searches the page for code that matches the code of known server behaviors. If the code of a
server behavior changes, the panel does not recognize earlier versions of the behavior on that page.

Retain the old and new versions of the behavior in the panel

Click the Plus (+) button on the Server Behaviors panel (Window > Server Behaviors), select New Server Behavior, and create a copy of the old

server behavior.

Edit the code of a server behavior created with the Server Behavior Builder

1. In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Edit Server Behaviors from the pop-up

menu.

The Edit Server Behaviors dialog box displays all the behaviors for the current server technology.

2. Select the server behavior and click Edit.

3. Select the appropriate code block and modify the code, the parameter marks, or the position of the code block to be inserted in pages.

4. If the modified code does not contain any designer-supplied parameters, click OK.

Dreamweaver regenerates the server behavior without a dialog box. The new server behavior appears in the Plus (+) pop-up menu of the
Server Behaviors panel.

5. If the modified code does contain designer-supplied parameters, click Next.

Dreamweaver asks you whether you want to create a new dialog box, overwriting the old one. Make your changes and click OK.

Dreamweaver saves all changes in the server behavior’s EDML file.

Coding guidelines

In general, your server behavior’s code should be compact and robust. Web application developers are very sensitive to the code added to their
pages. Follow generally accepted coding practices for the document type’s language (ColdFusion, JavaScript, VBScript, or PHP). When writing
comments, consider the different technical audiences that might need to understand the code, such as web and interaction designers, or other web
application developers. Include comments that accurately describe the purpose of the code, and any special instructions for including it within a
page.

Keep in mind the following coding guidelines when you create server behaviors:

546

This manual is related to the following products: