So, today's puzzle isn't really a code challenge, but more of a trivia contest. The first person to both answer my question, and explain the answer, wins, um, respect and Kudo(tm) points, but nothing else. Ready?
By default, CFML tags will either look like this, <cffoo> or like this, <cf_foo>. However, there is one more format that works as well. Tell me what the format is, how it works, and why it exists.
Archived Comments
Raymond,
The only thing I can think of is cfx_ or <imported:tagname /> the first is old news, the second well I am assuming this is not it but if it is it exist to incoporate taglibs into ones code, or even if you have it jsptaglibs.
But if this is not it, you have me very curious indeed:-)
Well I will take a stab at it.
You can do anything you do with tags inside of <cfscript>, so it would just be foo. I'm not sure why, but many claim that cfscript is more readable and for sure it looks like less typing than tags.
Justice: you can't call the cfthrow tag, for instance, in cfscript unless you define a suitable function.
Maybe Ray means calling via cfmodule ?
Are you looking for <cfmodule>? The primary reason I use cfmodule is to specify the directory that contains my custom tag code. Other reasons would be to group attributes into a structure before calling the tag making more readable, better documented code. If I define my structure in a cfscript block I can put a comment to the right of each attribute. I can't do that if I'm passing the attribute in at the <cfmodule> or <cf_tag> line.
Or are you looking for something more esteric like <dbquery> :)
I am gonna have to go with the imported tag library style as Andrew stated above <prefix:tag />. JSP tab libraries are one reason, but the other reason is that you can specify a relative path via the TAGLIB attribute. This allows custom tag libraries to be stored in different directories within a single application without having to use mapped paths. And, controversial as it may seem, I looked at mapped paths as the poor-man's solution to a problem (just my personal opinion, you don't have to agree with it).
I would agree with you guys about <module>, but I think Ray was looking for a way to call existing tags, not custom created tags (there are like 10 different ways to call custom tags)
Well, the CFIMPORT and CFX things are right, but not what I meant. I apologize for forgetting that. Keep digging guys - there is one more way.
While its not a *tag* format, you can mimic some tag functionality via the coldfusion ServiceFactory (ex. CFQuery can be done without the CFQuery tag this way).
they can look like <foo> or even <a> or <table> if you use the <cfimport> tag and don't put a prefix on it. such as
<cfimport taglib="/taglib/" />
which is sneaky way to make your coworkers' html tags behave funny.
I believe cftags can be used within cfscript if you use UDF's such as the CFMLLib. That way a cfexecute you can you execute inside the cfscript. Is this what you were thinking?
Nope.
I'll give a hint. This is "Old School" stuff.
Well if you had asked this question before ColdFusion MX came out I would have thought you meant the old tag format like <dbfoo> that was left over as a legacy from the early versions before the language was called ColdFusion Markup Language and was instead just Database Markup Language (if I remember correctly). This syntax appears to have been removed in the post-MX versions, so I doubt that is what you're looking for today.
Az: Not quite that old, and what I'm talking about still works today, although I don't think anyone uses it.
If I don't get an answer by 10, I'll give another hint.
It's 10 my time :)
you wouldn't be talking abou the <cfexecute> tag would you?
Brian no, that is a "normal" cf... tag.
yeah, i know. but you can "use" it like a custom tag if your off your rocker. It's past 10 min btw.
You aren't talking about the cfa from spectra are you? I originially ruled it out because cfx wasn't correct, but then cfx's are not cfml where cfa's were.
Chris wins! It was built for Spectra and let you do:
<cfa_foo>
One differnece between cfa_foo and cf_foo is that when doing cf_foo, CF looks for foo.cfm. But when you do cfa_foo, CF looks for cfa_foo.cfm.
hahah, I was googling for cfa's and I found this comment at the bottom of one of the pages:
"Output Within Handlers
In Allaire Spectra 1.0, <cfoutput> must be used within handlers to display anything. Forgetting to use <cfoutput> is easy, so don't forget it!
In Allaire Spectra 1.0.1, this is not the case. The wonderful Raymond Camden contributed a modification to the source code that eliminates this need. Watch for the soon-to-be-famous term "RAY MOD"."
You were famous long ago Ray! If you wanna check it out, here you go: http://www.adobe.com/devnet...
Long ago? What am I now, chopped liver? ;)
Ah, those were the days....
Hay this was so fun, lets do this again ;-)