Building a tag editor
207
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.
Using OPTIONLinearLayout
Here is a version of the mytag layout template that responds to user preferences for
single line or indented layout:
<taglayout>
<WIZIF OPTIONLinearLayout EQ ’true’>
<WIZSET Spacer = ’ ’>
<WIZELSE>
<WIZSET Spacer = Chr(13) & Chr(10) & ’ ’>
</WIZIF>
<mytag color="$${clrBGColor}"$${Spacer}face="$${fontFace}
"$${Spacer}size="$${txtSize}">
</taglayout>
The template would generate a tag based on the following user layout preference:
LINEAR:
<mytag color="White" face="Arial" SIZE="10">
NONLINEAR:
<mytag color="White"
face="Arial"
size="10">
Using TAGDATAUnknownAttributes
The
TagDataUnknownAttributes
tag contains the list of attributes that are contained
in the original tag string but are not supported by the editor. For example, you can
write an editor for the HTML tag
input
. that provides editing capabilities for all basic
attributes, however, the editor will not cover JavaScript event attributes such as,
onCLick
). To prevent loss of what are in effect unknown attributes during the editing
process, the editor engine creates the TagDataUnknownAttributes variable
containing a list of unknown attributes together with their original values. You can
use this variable to “stamp” all the unsupported attributes at the end of the tag you
are generating.
<taglayout>
<mytag color="$${colorBGColor}">
<wizif TagDataUnknownAttributes NEQ’’> $$TagDataUnknownAttributes
</wizif>
</taglayout>
If you edit a tag
<mytag color="Blue" onClick="CallThis">
, the above template
preserves the
onClick
attribute even though it is not supported in the editor.
Summary of Contents for HOMESITE
Page 11: ...Contents xi Table of CommandID values 310 Table of SettingID values 314 Glossary 323...
Page 12: ...xii Contents...
Page 20: ...xx About This Book...
Page 28: ...8 Chapter 1 Setting Up the Product...
Page 70: ...50 Chapter 4 Managing Files...
Page 88: ...68 Chapter 5 Writing Code and Web Content...
Page 116: ...96 Chapter 6 Editing Pages...
Page 148: ...128 Chapter 7 Using Web Development Languages...
Page 190: ...170 Chapter 11 Deploying Files...
Page 210: ...190 Chapter 12 Testing and Maintaining Web Pages...
Page 216: ...196 Chapter 13 Extending the Help System...
Page 350: ...330 Glossary...
Page 358: ...338 Index...