Friday Puzzler: ColdFusion Trivia

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

Comment 1 by Andrew Scott posted on 8/4/2006 at 4:18 PM

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:-)

Comment 2 by Justice posted on 8/4/2006 at 4:31 PM

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.

Comment 3 by Tom Chiverton posted on 8/4/2006 at 4:47 PM

Justice: you can't call the cfthrow tag, for instance, in cfscript unless you define a suitable function.

Maybe Ray means calling via cfmodule ?

Comment 4 by djuggler posted on 8/4/2006 at 4:48 PM

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> :)

Comment 5 by Ben Nadel posted on 8/4/2006 at 4:50 PM

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).

Comment 6 by Justice posted on 8/4/2006 at 4:55 PM

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)

Comment 7 by Raymond Camden posted on 8/4/2006 at 5:09 PM

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.

Comment 8 by Ben Nadel posted on 8/4/2006 at 5:33 PM

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).

Comment 9 by brian joseph posted on 8/4/2006 at 5:34 PM

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.

Comment 10 by Becky Zimmerman posted on 8/4/2006 at 5:43 PM

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?

Comment 11 by Raymond Camden posted on 8/4/2006 at 5:45 PM

Nope.

I'll give a hint. This is "Old School" stuff.

Comment 12 by Az posted on 8/4/2006 at 5:50 PM

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.

Comment 13 by Raymond Camden posted on 8/4/2006 at 5:56 PM

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.

Comment 14 by Ben Nadel posted on 8/4/2006 at 6:01 PM

It's 10 my time :)

Comment 15 by brian joseph posted on 8/4/2006 at 6:04 PM

you wouldn't be talking abou the <cfexecute> tag would you?

Comment 16 by Raymond Camden posted on 8/4/2006 at 6:06 PM

Brian no, that is a "normal" cf... tag.

Comment 17 by brian joseph posted on 8/4/2006 at 6:07 PM

yeah, i know. but you can "use" it like a custom tag if your off your rocker. It's past 10 min btw.

Comment 18 by Chris Stoner posted on 8/4/2006 at 6:14 PM

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.

Comment 19 by Raymond Camden posted on 8/4/2006 at 6:22 PM

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.

Comment 20 by Justice posted on 8/4/2006 at 6:24 PM

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...

Comment 21 by Raymond Camden posted on 8/4/2006 at 6:31 PM

Long ago? What am I now, chopped liver? ;)

Comment 22 by Nathan Dintenfass posted on 8/4/2006 at 7:06 PM

Ah, those were the days....

Comment 23 by Camilo Trevino posted on 8/4/2006 at 7:58 PM

Hay this was so fun, lets do this again ;-)