Adobe Dreamweaver CS3 Uživatelský manuál Strana 599

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 738
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 598
DREAMWEAVER CS3
User Guide
592
When the page designer clicks the Plus (+) button on the Server Behaviors panel, the new server behaviors title will
appear in the pop-up menu. When a designer applies an instance of a server behavior to a document, the behavior
appears in the list of applied behaviors in the Server Behaviors panel. Use the Server Behavior Title box to specify
the contents of the Plus (+) pop-up menu and the list of applied behaviors.
The initial value in the box is the name you supplied in the New Server Behavior dialog box. As parameters are
defined, the name is automatically updated so that the parameters appear inside parentheses after the server behavior
name.
Set Session Variable (@@Name@@, @@Value@@)
If the user accepts the default value, everything before the parentheses appears in the Plus (+) pop-up menu (for
example, Set Session Variable). The name plus the parameters will appear in the list of applied behaviors—for
example, Set Session Variable ("abcd", "5").
Code Block to Select Specifies what code block is selected when the user selects the behavior in the Server Behaviors
panel.
Whenyouapplyaserverbehavior,oneofthecodeblockswithinthebehaviorisdesignatedthe“codeblocktoselect.
If you apply the server behavior and then select the behavior in the Server Behaviors panel, the designated block is
selected in the Document window. By default, Dreamweaver selects the first code block that is not above the
html
tag. If all the code blocks are above the html tag, then the first one is selected. Advanced users can specify which code
block is the selected one.
Creating code blocks
ThecodeblocksyoucreateintheServerBehaviorBuilderareencapsulatedinaserverbehaviorthatappearsinthe
Server Behaviors panel. The code can be any valid run-time code for the specified server model. For example, if you
choose ColdFusion as the document type for your custom server behavior, the code you write must be valid
ColdFusion code that runs on a ColdFusion application server.
You can create the code blocks either directly in the Server Behavior Builder, or you can copy and paste the code from
othersources.EachcodeblockyoucreateintheServerBehaviorBuildermustbeasingletagorscriptblock.Ifyou
must insert multiple tag blocks, split them into separate code blocks.
Conditions in code blocks
Dreamweaver lets you develop code blocks that incorporate control statements that execute conditionally. The
Server Behavior Builder uses
if, elseif, and 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 following example shows the
if, elseif,andelse statements. The square brackets ([ ]) denote optional code
andtheasterisk(*)denoteszeroormoreinstances.Toexecuteaportionofacodeblockortheentirecodeblockonly
if a certain condition or conditions apply, use the following syntax:
<@ if (expression1) @>conditional text1[<@ elseif (expression2) @>conditional text2]*[<@
else @>
conditional text3]<@ endif @>
Condition expressions can be any JavaScript expression that can be evaluated using the JavaScript eval() function,
and may include a server behavior parameter marked by @@’s. (The @@’s distinguish the parameter from JavaScript
variables and keywords.)
September 4, 2007
Zobrazit stránku 598
1 2 ... 594 595 596 597 598 599 600 601 602 603 604 ... 737 738

Komentáře k této Příručce

Žádné komentáře