PDA

View Full Version : Creating Your Own Custom Tag Paths



jakeh
April 17th, 2010, 07:03 PM
Starting in ColdFusion 8, ColdFusion allows creation of Custom Tag Paths in each site's Application.cfc file. This allows you to create and manage your Custom Tag Paths without having to use CF Administrator (ie. submit a support ticket). The following steps will help you set up a Custom Tag Path:


If you do not already have an Application.cfc file in your site's Web root, create one now.
Place the following code in the Application.cfc file and save:

<cfcomponent>
<cfset THIS.customtagpaths="d:\home\yourdomain.com\wwwroot\customtagfolder">
</cfcomponent>

In this case, you'd replace "yourdomain.com" with your domain name, and "customtagfolder" with the name of the folder you created for your custom tags.

Now you have successfully added your custom tag path. If you have multiple tag paths to add, try using the following code instead:

<cfcomponent>
<cfset THIS.customtagpaths=ListAppend(THIS.customtagpaths , "d:\home\yourdomain.com\wwwroot\customtagfolder")>
</cfcomponent>


References:
CF9 Livedocs - Application Variables (http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-750b.html)
FusionGrokker - Relative Custom Tag Paths: Friend or Foe? (http://fusiongrokker.com/post/relative-custom-tag-paths-friend-or-foe)