Common Attributes
Some Escenic tag attributes are used in the same way everywhere they appear:
id Attributes
In contrast to some other tag libraries (including the Struts tag
libraries), id
attributes are often
not required. Whether or not an
id
attribute is required, it always has the same
purpose. The id
attribute is used to specify both the
name of a scripting variable and the key of a page attribute that can be
used to access the value returned by the tag. For example, the template
in Content Item Templates shows the
article:field
tag used to retrieve article fields as
follows:
<h1><article:field field="headline" /></h1>
However, article:field
has an id
attribute, so the same effect could be achieved as follows:
<article:field field="headline" id="myHeadline"/> <h1><util:valueof param="myHeadline" /></h1>
If an id
is optional and is not specified, then the
result returned by the tag is printed (that is, replaces the tag in the
final output).
name Attributes
The name of a bean that is to be used by the tag. In the following
example, the switch
tag will contain
case
tags that test the value of the
article
bean's articleTypeName
property.
<util:switch name="article" property="articleTypeName"> ... </util:switch>
property Attributes
The name of a property (of the bean identified by the
name
attribute) that is to be used by the tag. If not
specified, the bean identified by the name
attribute
itself will be used as the value. See above for an example.