User Guide

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.