Copy link to clipboard
Copied
Hi ,
I have one question on custom tag.How the server knows whether it is custom tag or not?
Advance Thanks,
Chandra kaladhar
Copy link to clipboard
Copied
Hi, Chandra,
The two most common ways ColdFusion "knows" if a CFML file is a custom tag:
1. It's in the same directory as the CFML file calling it.
2. It's stored in the global "custom tags" directory. The location of this varies based on how and onto what OS you've installed CF. On my Mac, I installed CF 8 with the multi-server configuration option, running on JRun4. So, for me, it's in /Applications/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/CustomTags. On my PC development machine, which has CF 8 installed and integrated with IIS, it's in E:\ColdFusion8\CustomTags
Hope that helps.
Copy link to clipboard
Copied
Thanks craigkaminsky,
Internally how coldfusion application server knows if it is custom tag or not.Is there any execution process is there.
Thanks,
Copy link to clipboard
Copied
Sorry! If you build a custom tag and place it in a file called "mycustomtag.cfm" and then call that file as so:
<cf_mycustomtag ...params />
ColdFusion will check for a file named "mycustomtag.cfm" in the locations I mentioned before. As you go further down the road with custom tags, you can look into using cfimport and some other methods of accessing and executing your tags. But for now, this should get you started.
Here's a link to the CF LiveDocs on creating and using custom tags:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=reuseCode_1.html
Copy link to clipboard
Copied
Notice also a new feature of Coldfusion8 which allows you to specify a customtag path (or paths) that is(are) specific to your application.
For tis feature to work the "Enable per app settings" checkbox mus be enabled in the CF administrator (should be enabled by default)
Then, in your application.cfc, use
<cfset this.customTagPaths = "path1, path2,..."/>
Those paths are then added to the places where ColdFusion looks for custom tags.
I use this a lot since on a shared hosting environnment, I don't have access to c:\coldFusion8\customTags.
Also, the custom tags places in c:\coldFusion8\customTags can be consumed by any application running on that server instance, and, in most cases, I use customTags that I developped specifically fo that one App.
Hoe it helps
Damien
For more, see liveDocs
http://livedocs.adobe.com/coldfusion/8/htmldocs/index.html
(!!! typo error on livedocs. the customtagpaths application variable ens with an s)
Copy link to clipboard
Copied
Thanks all,
My question is how the coldfusion server knows,if it is customtag?Behind the scenes how it executes?
Thanks,
Copy link to clipboard
Copied
CF "knows" it's a custom tag because you'll prefix "CF_" to the tag name when you call it. See http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001071.htm for full details.