beautypg.com

Tagspec – Adobe Extending Dreamweaver CS4 User Manual

Page 13

background image

7

EXTENDING DREAMWEAVER CS4

Customizing Dreamweaver

String-delimited tags start with one string and end with another string. They are like empty HTML tags (such as

img

) in that they don’t surround content and don’t have closing tags. If the

happy

tag were a string-delimited tag,

the tag specification would include the

start_string

and

end_string

attributes. An ASP tag is a string-delimited

tag; it starts with the string

<%

and ends with the string

%>

, and it has no closing tag.

The following information describes the attributes and valid values for the

tagspec

tag. Attributes marked with an

asterisk (*) are ignored for string-delimited tags. Optional attributes are marked in the attribute lists with curly braces
(

{}

); all attributes not marked with curly braces are required.

Description
Provides information about a third-party tag.

Attributes

tag_name, {tag_type}, {render_contents}, {content_model}, {start_string}, {end_string},

{detect_in_attribute}, {parse_attributes}, icon, icon_width, icon_height, {equivalent_tag},

{is_visual}, {server_model}

tag_name

is the name of the custom tag. For string-delimited tags,

tag_name

is used only to determine whether a

given Property inspector can be used for the tag. If the first line of the Property inspector contains this tag name
with an asterisk on each side, the inspector can be used for tags of this type. For example, the tag name for ASP code
is

ASP

. Property inspectors that can examine ASP code should have

*ASP*

on the first line. For information on the

Property inspector API, see

Property inspectors

” on page 214.

tag_type

determines whether the tag is empty (as the

img

tag is), or whether it contains anything between its

opening and closing tags (as the

code

tag does). This attribute is required for normal (nonstring-delimited) tags.

It’s ignored for string-delimited tags because they’re always empty. Valid values are

"empty"

and

"nonempty"

.

render_contents

determines whether the contents of the tag should appear in the Design view or whether the

specified icon should appear instead. This attribute is required for nonempty tags and is ignored for empty tags.
(Empty tags have no content.) This attribute applies only to tags that appear outside attributes. The contents of tags
that appear inside the values of attributes of other tags are not rendered. Valid values are

"true"

and

"false"

.

content_model

describes what kinds of content the tag can contain and where in an HTML file the tag can appear.

Valid values are

"block_model"

,

"head_model"

,

"marker_model"

, and

"script_model"

.

block_model

specifies that the tag can contain block-level elements such as

div

and

p

, and that the tag can

appear only in the body section or inside other body-content tags such as

div

,

layer

, or

td

.

head_model

specifies that the tag can contain text content and that it can appear only in the head section.

marker_model

specifies that the tag can contain any valid HTML code, and that it can appear anywhere in an

HTML file. The HTML validator in Dreamweaver ignores tags that are specified as

marker_model

. However,

the validator doesn’t ignore the contents of such a tag; so even though the tag itself can appear anywhere, the
contents of the tag may result in invalid HTML in certain places. For example, plain text cannot appear (outside
a valid head element) in the head section of a document, so you can’t place a

marker_model

tag that contains

plain text in the head section. (To place a custom tag containing plain text in the head section, specify the tag’s
content model as

head_model

instead of

marker_model

.) Use

marker_model

for tags that should be displayed

inline (inside a block-level element such as

p

or

div

—for example, inside a paragraph). If the tag should be

displayed as a paragraph of its own, with line breaks before and after it, don’t use this model.

script_model lets the tag exist anywhere between the opening and closing HTML tags of a document. When
Dreamweaver encounters a tag with this model, it ignores all of the tag’s content. Use this tag for markup (such
as certain ColdFusion tags) that Dreamweaver shouldn’t parse.

This manual is related to the following products: