
178
Chapter 13 Customizing the Development Environment
Variables passed to the layout template
The value of each control of the tag editor is passed to the template using a variable
with the same name, for example, a ColorPicker control named
colorBGColor
will
pass its value in a
colorBGColor
variable. The
taglayout
template can then use this
data to generate the tag string.
<taglayout>
<mytag color="$${colorBGColor}">
</taglayout>
This example shows a simple layout template for a hypothetical tag with a single
attribute,
color
. Notice that variables are embedded using the $${} delimiters. If the
user selects White in the
colorBGColor
ColorPicker control, the template generates
this tag:
<mytag color="White">
Special variables
In addition to the control variables, a few other parameters get sent to the
taglayout
template:
•
OPTIONLowerCaseTags
Returns true or false. Specifies whether the tag should
be generated using lowercase.
•
EDITORTagIndentString
Maintains indentation for tag attributes and body.
•
OPTIONLinearLayout
Returns true or false. Specifies whether the tag should be
generated with its attributes in a single line or not.
•
TAGDATAUnknownAttributes
A string containing all attributes which were
contained in the edited tag string but are not recognized by the editor.
Using OPTIONLowerCaseTags
You can use this parameter to create a layout template, which generates a tag in
lower or upper case based on user preferences. Here is a version of the mytag layout
template responding to case preferences:
<taglayout>
<WIZIF OPTIONLowerCaseTags EQ ’true’>
<mytag color="$${colorBGColor}">
<WIZELSE>
<mytag COLOR="$${colorBGColor}">
</WIZIF>
</taglayout>
Maintaining tag indentation
The variable
EditorTagIndentString
contains an indentation string for the
currently selected tag. If the start tag is indented using tabs and characters, the string
is represented as the corresponding combination of tabs and spaces. This variable
can be used to correctly indent tag attributes, as well as tag body contents for tags
which are already indented.
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...