VTML Tag Definitions

 

 Introduction 

This page contains some documentation about layout and behavior of the VTML Tag Definitions (that is: tag definitions for VTML - all tag definitions are written in VTML!): how to use them and what (not) to expect from them. It will also explain why certain decisions were taken (like omitting input fields for LFWIDTH and LFHEIGHT). The current version number and date are mentioned with each description.

What this page does not do is explain is the techniques that were used to accomplish what they do: That sort of information is to be found in the Tips and Techniques outside link section (on-line); where appropriate examples from these tag editors will be used.

One general user interface aspect of the VTML Tag Editors should be mentioned here rather than repeated everywhere: While it is not (yet) possible to mark an attribute as required in the VTML for the tag that uses that attribute, and pop up an error message when a required attribute is omitted, There is a half-way solution. Every attribute that is required is simply marked with an asterisk: Required attribute. The same technique is used in all HTML and VTML tag editors; for the VTML tag editors the asterisk used is green, other colors are used in the HTML tag editors (while taking care that color difference never is the only signal). As with the HTML Tag Editors, required attributes are always written even if no value has been entered: this will serve as another visual reminder that a value really is needed for the attribute and should trigger an error message when validating the code.

VTML 2All tag definitions are written in VTML 2 syntax and the Tag Editors also produce tags conforming to VTML 2 syntax (except those for WIZML statements as these do not use the new "XML" form). This new syntax was introduced with HomeSite and ColdFusion Studio 4.0 but is completely compatible with the older 3.x versions of these programs.

All tag definitions also contain full support for Tag Inspector and Tag Insight.
But all these tag definitions have also been kept completely compatible with HomeSite 3.01 / ColdFusion Studio 3.11: the tag editors that calculate LFWIDTH and LFHEIGHT still use the old method instead of the newly introduced numeric functions. Of course some of the new features like support for Tag Inspector will be active only when used with HomeSite 4.0 or ColdFusion Studio 4.0.  to menu

 TagChooser 

 MarkUpTags.vtm 

The updated version of MarkUpTags.vtm (the file that controls the TagChooser) that comes with this set of visual tag editors now completely exploits the techniques that were introduced for the VTML section only with the first release of this set of VTML tag editors on HomeSite Help outside link . Some important properties of this version of TagChooser:

  1. The HELPFILE attributes for all VTML and WIZML tags now refer to the new, more extensive VTML documentation files. The best way to take advantage of this is to use the "Show help in separate window." button Show help in separate window: when this browser window is used, links to other pages work; if you use the "Toggle Embedded Help" button Toggle Embedded Help to show the help information, only links within a page will work. (The same is true for help for the visual tag editors.)

  2. Better classification of tags; visually recognizable by specially-designed bitmaps.

  3. MarkUpTags.vtm is now designed so that in the right-hand listbox you can see the difference between a tag that is inserted into your document directly and a tag that has a visual editor: tags that are inserted directly are shown as tag with angle brackets (<>), and if an end tag is written, that is shown as well. Tags for which there is a visual editor are shown only by name.

The last two points illustrate an important user interface design consideration: recognition is easier than recall. For instance, if you use the same tags over and over from the tag chooser, eventually you'll probably know (recall) which ones have an editor and which ones are inserted directly. But if the user interface can simply remind you of that fact (recognition) it'll be easier on your memory: you can use your brains to concentrate on the content rather than trying to remember which tag has an editor and which one doesn't. (Read more about this and other techniques for the MarkUpTags.vtm file in the Tips and Techniques: Tag Chooser outside link page on-line.)

This technique for showing which tags have an editor and which ones don't is now used throughout this MarkUpTags.vtm file.

 Tag Definitions 

 <TAG> 

This is one of the simplest tag editors. BODYEDITING is now treated as a flag; code which uses "Yes" or "No" attribute values is recognized by the Tag Editor but Tag Inspector does not handle this correctly. Edit old code with the Tag Editor before using Tag Inspector.

 <EDITORLAYOUT> 
 <CONTAINER>  (Tag Editors and Wizards)
 <CONTROL>  (Tag Editors and Wizards)

Everything already mentioned for LFWIDTH and LFHEIGHT with CONTAINER also holds here. The same is true for not quoting numerical values.

There are a few special aspects to mention about the CONTROL editor though:

 <ITEM>  (Tag Editors and Wizards)
 <ATTRIB> 
 <ATTRIBOPTION> 

VTML 2 A very simple tag definition with just two attributes: VALUE and CAPTION (similar to the ITEM tag).

 <EVENT> 

VTML 2 This tag definition supports only a single attribute: the event name. But it is not as simple as it seems: For both a Tag Editor and Tag Inspector the difference between HTML 4.0 standard events and other events supported as extensions by some browsers and scripting languages is made obvious. In the Tag Editor, choosing a standard event overrules the choice of a browser/language-specific event.

 <ATTRIBCATEGORIES> 

VTML 2 The tag ATTRIBCATEGORIES itself does not take any attributes. The only function of this tag definition is to allow a Tag Editor to generate initial ATTRIBGROUP tags. This generation works the same way as generation of ITEM tags for a CONTROL or generation of ATTRIBOPTION tags for an ATTRIB. ATTRIBGROUP tags are written with the value of NAME and ELEMENTS attributes initially filled with the sequence number of the ATTRIBGROUP tag.

 <ATTRIBGROUP> 

VTML 2 A very simple tag definition with just two attributes: NAME and ELEMENTS.

 <TAGLAYOUT> 

The TAGLAYOUT editor is quite simple. There are now only two attributes: SECTION and TRIMWHITESPACE. For both attributes the rule is that it will not be written if the chosen value is default.

VTML 3 Support for the new TRIMWHITESPACE attribute was added in version 2.04.

 <TAGDESCRIPTION> 

Not much to report here except it tries a little harder than the original in HomeSite and ColdFusion Studio 3.0 to get the layout correct when you don't enter a helpfile but enter a tag body instead.

Note: The Tag Editor supports BodyEditing for embedded help text. HTML markup can be included (though HomeSite and ColdFusion Studio 3.x do not support editing markup in an exiting tag body).

When writing the tag, the difference in syntax between an empty tag (reference to a help file) and a container tag (help information included as a tag body) into account.

 Wizards VTML 2

 <WIZARD> 

A simple tag editor with three optional attributes. The only thing of note is that in the Tag Editor the IMAGE attribute is supported with a file browser while the TAGLAYOUT section takes care of converting the relative URI syntax into the special syntax needed by a Wizard. To avoid problems with this syntax, the data type for this attribute in Tag Inspector is kept as "Text" (default) instead of "Relativepath" since Tag Inspector cannot do such processing when writing an attribute value.

 <PARAM> 

Writing this tag definitions presented an interesting problem: HTML has a PARAM tag, used with the APPLET tag and in HTML 4.0 with the OBJECT tag. In VTML 2, PARAM can be used in combination with the WIZARD tag and with the PAGE tag. In all four cases, the set of possible attributes is somewhat different although there is an overlap; and for Wizards the VALUE attribute is required while it isn't for Applets and Objects.

The original idea was to simply make a different tag definition for HTML and Wizard VTML. But both must be PARAM.VTM. With HomeSite 3.01 and ColdFusion 3.11 the problem was immediately obvious: all tag definitions must be in the same directory and you can't have two of the same name; a different name for one would allow inserting a new attribute using a different definition - but not editing an existing tag. For HomeSite 4.0 and ColdFusion 4.0 there seemed to be a solution: tag definitions are sorted into different subfolders; but no, these programs use a searching algorithm to find a tag definition: while different ones of the same name are possible, only one will ever be used: the one the searching algorithm finds first.

What you'll find here is the workaround for this name-space ambiguity problem: a single tag definition that includes the functionality both for use with HTML (for APPLET and OBJECT) as well as for use with Wizard VTML (for WIZARD and PAGE). Here's how it works:

You should always make sure you're using the correct tabs when writing a tag with this Tag Editor; differences in behavior include writing VTML 2 syntax for VTML and treatment of required and optional attributes.

VTML 2 In Tag Inspector, the control attributes used for tab preselection will show up in the normal view as long as there is no mechanism to prevent this; in the Categorized view they won't be visible and HTML and VTML have separate categories.

 <TEMPLATE> 

VTML 2 A simple tag definition which supports all four possible attributes. For now, controls are all simple textboxes and data types all default (Text).

 <PAGE> 

VTML 2 A tag definition with support for all documented attributes. Same handling of the IMAGE attribute as with the WIZARD tag definition.

For a Tag Editor, the attribute TYPE="Dynamic" which is required for user-defined Wizards, is treated as un uneditable required attribute. For Tag Inspector this is documented by using an enumerated type with just one value and an appropriate caption.

 <INPUT> 

VTML 2 Similar to the PARAM Tag Definition, the INPUT tag definition includes the functionality both for use with HTML (for FORMs) as well as for use with Wizard VTML (for WIZARD). Here's how it works:

You should always make sure you're using the correct tabs when writing a tag with the Tag Editor; differences in behavior include writing VTML 2 syntax for VTML and treatment of required and optional attributes.

VTML 2 In Tag Inspector, the control attribute used for tab preselection will show up in the normal view as long as there is no mechanism to prevent this; in the Categorized view they won't be visible and HTML and VTML have separate categories.

 <NEXTPAGE> 

VTML 2 A simple tag definition with just two required attributes. Although the second attribute is a condition, no condition builder as in WIZIF has been included for now.

 WIZML logic 

 <WIZIF> 

WIZIF takes only one argument: a condition. Alas, an argument is not the same thing as an attribute which can always be recognized by a keyword. This implies that it is (currently) impossible for a tag editor to read and display the condition in a WIZIF (or WIZELSEIF) statement.

But when starting out with VTML (WIZML in this case) many people have trouble remembering how to write the comparison operators (always depending on what other programming languages you've used before). So again on the principle that recognition is better than recall, a write-only tag editor was created with a simple condition builder. At least that will remember the comparison operators for you, and it makes a reasonable stab at creating syntactically correct conditions with brackets where appropriate. If you edit a WIZIF tag with it, you will have to re-build the expression (which may actually turn out to be better than editing one).

 <WIZELSEIF> 

Essentially the same as the WIZIF editor; it only writes a different tag.

 <WIZLOOP> 

WIZLOOP is a little easier than WIZIF/WIZELSEIF since it does have real attributes that can be recognized and displayed in the editor. One problem remains: there are three types of WIZLOOP (at least I'm supporting three types) but the type is not indicated by an attribute.

I've chosen to have a tab page for each type, but when editing a WIZLOOP tag, the tab page will not (cannot) be selected automatically.

The tab for a conditional loop contains a condition builder like the one for WIZIF and WIZELSEIF. But there's a difference: in WIZLOOP the condition is indicated by a keyword so while editing the tag the current expression can be displayed as a string. (Of course it cannot be parsed into the separate pieces in the condition builder.) Now you have the choice: either you edit the current condition as a string, or you use the condition builder to create a new one. If you do both, the editor remembers the condition string as it was before you edited it, and uses the fact it was changed to give precedence to the edited condition rather than the input in the condition builder. It's a straight string comparison, so if you edit and end end up with the same string, the tag editor should not notice any change.

 <WIZINCLUDE> 

In HomeSite 3.01 and ColdFusion Studio 3.11 the statement WIZINCLUDE worked only in Wizard templates which could be customized (though Wizard user interfaces could not). For HomeSite / ColdFusion Studio 4.0 and later we can now define our own Wizards so WIZINCLUDE has a more important function. However, WIZINCLUDE still does not work inside the context of a Tag Editor.