Chapter 7: Reusing Code
85
<CFIF ThisTag.ExecutionMode is ’end’>
<CFSET ThisTag.GeneratedContent =
’<!--#ThisTag.GeneratedContent#-->’>
</CFIF>
Installing Custom Tags
Custom tags are just like other .cfm files except that they must be installed in a specific
location to be accessible from the calling template. Because ColdFusion loads the first
instance it finds of the custom tag called by a template, you should avoid placing
copies of a custom tag in different locations.
Local tags
The ColdFusion engine first searches for a custom tag in the directory of the calling
template. This allows you to keep a custom tag file in the same directory as the page
that uses it.
Shared tags
To share a custom tag among applications in multiple directories, place it in the
Custom Tags folder under your ColdFusion installation directory, for example
C:\CFUSION\CustomTags
. You can create sub-folders to organize custom tags.
ColdFusion searches recursively for the Custom Tags directory, stepping down through
any existing subdirectories until the custom tag is found.
Managing Custom Tags
If you deploy custom tags in a multi-developer environment or distribute your tags
publicly, you may want to make use of additional ColdFusion capabilities:
•
An advanced invocation syntax to resolve possible name conflicts
•
Advanced security
•
Template encoding
Resolving file name conflicts
To avoid errors caused by duplicate custom tag file names, use the CFMODULE tag in
the calling template. Note that only one of the required attributes can be used in a
given instance of the tag.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...