User Guide
82 Developing Web Applications with ColdFusion
Examples
Via CFMODULE
<CFSET zort=StructNew()>
<CFSET zort.X = "-X-">
<CFSET zort.Y = "-Y-">
<CFMODULE TEMPLATE="testtwo.cfm"
a="blab"
attributecollection=#zort#
foo="16">
Via shorthand
<CFSET zort=StructNew()>
<CFSET zort.X = "-X-">
<CFSET zort.Y = "-Y-">
<CF_TESTTWO a="blab" attributecollection=#zort# foo="16">
Accessing attributes within the custom tag
If testtwo.cfm contains this CFML:
---custom tag ---<br>
<CFOUTPUT>#attributes.a# #attributes.x# #attributes.y#
#attributes.foo#</cfoutput>
<BR>--- end custom tag ---
Its output will be:
---custom tag ---
blab -X- 12 16
--- end custom tag ---
Executing Custom Tags
Tag instance data
During the execution of a custom tag template, ColdFusion keeps some data related to
the tag instance. The ThisTag scope is used to preserve this data with a unique
identifier. The behavior is similar to the File scope.
The following variables are generated by the ThisTag scope:
• ExecutionMode — valid values are "start" and "end."
• HasEndTag — used for code validation, it distinguishes between custom tags
that have and don't have end tags for ExecutionMode=start. The name of the
Boolean value is ThisTag.HasEndTag.
• GeneratedContent — can be processed as a variable.