Adobe Extending Dreamweaver CS4 Bedienungsanleitung Seite 254

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 387
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 253
248
EXTENDING DREAMWEAVER CS4
Server behaviors
<participant>
<quickSearch><![CDATA[MM_paramName]]></quickSearch>
<insertText location="aboveHTML+80">
<![CDATA[
<% var MM_paramName = ""; %>
]]>
</insertText>
<searchPatterns whereToSearch="directive">
<searchPattern><![CDATA[/var\s*MM_paramName/]]></searchPattern>
</searchPatterns>
</participant>
When Dreamweaver adds a server behavior to a document, it needs to have detailed information, including where to
insert the code, what the code looks like, and what parameters the Dreamweaver author or data replaced at runtime.
Each participant EDML file describes these details for each block of code. Specifically, the participant file describes the
following data:
The code and where to put the unique instance are defined by the insertText tag parameters, as shown in the
following example:
<insertText location="aboveHTML+80">
How to recognize instances already on the page are defined by the searchPatterns tag, as shown in the following
example:
<searchPatterns whereToSearch="directive">
<searchPattern><![CDATA[/var\s*MM_paramName/]]></searchPattern>
</searchPatterns>
In the searchPatterns block tag, each searchPattern tag contains a pattern that finds instances of runtime code
and extracts specific parameters. For more details, see
Server behavior techniques” on page 283.
The script file
Each server behavior also has an HTML file that contains functions and links to the scripts that manage the integration
of the server behavior code with the Dreamweaver interface. The functions that are available for editing in this file are
discussed in
Server behavior implementation functions” on page 256.
A simple server behavior example
This example shows the process of creating a new server behavior so you can see the files that Dreamweaver generates
and how to handle them. For details about working with the Server Behavior Builder interface, see “Adding Custom
Server Behaviors” in Getting Started with Dreamweaver. The example displays “Hello World” from the ASP server. The
Hello World behavior has only one participant (a single ASP tag) and does not modify or add anything else on the page.
To create the behavior, you create the dynamic page document, define the new server behavior, and define the code to
insert.
Creating the dynamic page document
1 In Dreamweaver, select the File > New menu option.
2 In the New Document dialog box, select Category: Dynamic Page, and Dynamic Page: ASP JavaScript.
3 Click Create.
Seitenansicht 253
1 2 ... 249 250 251 252 253 254 255 256 257 258 259 ... 386 387

Kommentare zu diesen Handbüchern

Keine Kommentare