Calling Custom Tags
There is no real installation process for custom tags other than to save them on your ColdFusion server. There are, however, different locations on the server where you can save the tags that affect whether they can be called locally by a single application or shared across all applications.
To call a custom tag from within a CFML
template, you simply prefix the template name of the tag with
CF_. Therefore, if you have a custom tag saved on
your server as MyTag.cfm, you call it like this:
<CF_MyTag>
When you call a custom tag from an application template, ColdFusion
looks for the tag in the same directory as the calling template. For
example, if your template resides in
c:\inetsrv\wwwroot\myapp and tries to call a
custom tag called CF_MyTag, ColdFusion looks for
the tag in the \myapp directory first. Saving a
custom tag in the same directory as its calling template makes the
tag a local tag. That is, the tag is available only to templates
residing in the same directory as the application. Using the
local-tag technique allows you to use custom tags in hosted
environments where you might not have access to the shared custom
tags directory.
The very nature of custom tags makes them ideal for sharing among
multiple applications on the server. In order to facilitate this, a
default custom tags directory is automatically created when you
install ColdFusion on your server. This directory is
c:\cfusion\customtags by default. Any custom tags saved in this directory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access