Interfaces such as Tag Insight and Tag Inspector require tag-specific information to operate properly. For instance, the Tag Inspector needs to know the attributes of the tag being edited, the type of each of those attributes, and, in special instances, the enumerated values of an attribute. Individual tag definition files store this information.
These tag definitions are stored in \Extensions\TagDefs\
. For instance, all the information about the APPLET
tag is stored in \Extensions\TagDefs\HTML\Applet.vtm
. The definition files are organized in language directories to prevent possible name conflicts between various markup languages.
Note | Whenever you make changes to a VTM file or create a new one, save the file then press Ctrl + Alt + Shift + C to apply the changes. |
The following features use tag definition files:
You can customize existing tag definitions and create new tag definition files. Every tag definition file contains the following markup structure:
<TAG> <ATTRIBUTES> ... Defines tag attribute properties and behavior </ATTRIBUTES> <ATTRIBCATEGORIES> ... Defines logical grouping for tag attributes </ATTRIBCATEGORIES> <EDITORLAYOUT> ... Defines the layout of a tag editor </EDITORLAYOUT> <TAGLAYOUT> ... Defines the tag generation template </TAGLAYOUT> <TAGDESCRIPTION> ... HTML-based documentation for the tag </TAGDESCRIPTION> </TAG>
You can create the definition file in three ways:
The ATTRIBUTES block defines attributes inside the main TAG block. The ATTRIBUTES block can contain ATTRIB tags.
The following example demonstrates the definition of four tag attributes: VALUE, TITLE, ALT, and ALIGN.
<ATTRIBUTES> <ATTRIB NAME="VALUE"> <ATTRIB NAME="TITLE"> <ATTRIB NAME="ALT"> <ATTRIB NAME="ALIGN"> </ATTRIBUTES>
In most cases, features such as Tag Insight require more than just the names of the attributes. You can use the ATTRIB tag to define:
The value type for a specific attribute can be specified using the TYPE attribute in the ATTRIB tag.
<ATTRIBUTES> <ATTRIB NAME="VALUE" TYPE="text" /> <ATTRIB NAME="BGCOLOR" TYPE="color"/> <ATTRIB NAME="FONTFACE" TYPE="font" /> </ATTRIBUTES>
Enumerated values can be specified for attributes of TYPE="Enumerated." A sub-tag ATTRIBOPTION is used to specify such values:
<ATTRIB NAME="CHARSET" TYPE="ENUMERATED"> <ATTRIBOPTION VALUE="iso-8859-1" CAPTION="Western" /> <ATTRIBOPTION VALUE="iso-8859-2" CAPTION="Central European (ISO)" /> <ATTRIBOPTION VALUE="iso-8859-8" CAPTION="Hebrew (ISO-Visual)" /> </ATTRIB>
The optional CAPTION attribute specifies the form in which the option appears in the dropdown lists, while the VALUE attribute specifies the underlying value used by the attribute.
Use the ATTRIBCATEGORIES section to define attribute categories. The categories are used to organize the attributes when viewed in the Tag Inspector. The ATTRIBCATEGORIES block can only contain ATTRIBGROUP tags. The following example demonstrates the definition of four categories.
<ATTRIBCATEGORIES> <ATTRIBGROUP NAME="Appearance" ELEMENTS="BACKGROUND,BGPROPERTIES,LEFTMARGIN,TOPMARGIN"/> <ATTRIBGROUP NAME="Colors" ELEMENTS="BGCOLOR,VLINK,ALINK,LINK,TEXT"/> <ATTRIBGROUP NAME="Misc" ELEMENTS="GIZMO"/> </ATTRIBCATEGORIES>