Integrating Coldfusion tag library into Application

I am wondering if anybody has a good suggestion on how to integrate a
tag library. Specifically, I am using Matt Quackenbush's Uniform tag
library QuackFuzed [ Ramblings of a Con..ColdFuzed Mind ] : Uni-Form Tag Library and
instead on calling on each of my Layout pages would like to just
implicitly have it available.

As I type this I realize I could also integrate via the
Application.cfc but really looking for a clean, maintainable solution.

thanks
Kevin

Kevin,

Unfortunately it is the nature of CF to require the <cfimport/> in each template (cfm file) that uses the tags. If you do not do so then the code is skipped by the CF engine and passed to the browser as pure XHTML. Try it, and then view source on the rendered page.

Now then, I have not personally tried it, but you should be able to register the tags in your server (e.g. place them in the server's custom tag directory) and then use the <cf_tagname> syntax instead of the <uform:form> syntax. I just never do that bexause of portability.

If you go that route and find that it works well, can you put up a blog post about it? If you do, make sure and send me the link so I can add it to the docs pages. :slight_smile:

Haven't tried this, but could you put the cfimport call in a ColdBox
UDF helper file?

Dave

No. The must be in the calling template.

Could you do an interceptor announcement pre-view rendering that calls
the cfimport?

Yes, matt is right, this is a nasty limitation in CF, where each template must have the cfimport call.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

That's too bad. Maybe that's why it's not something I've used in a
very long time (;-).

Dave

Nope, you can’t, reread the Adobe docs and tried interceptos. Truly has to be on the page. Well hopefully we won’t have too many layout files :slight_smile:

Kevin

Kevin,

Did you by chance give the <cf_tagname> syntax a shot?

No. I’m lazy, hehe. Well actually portability is important right now. I may change later, but have so many other things to think about.

I like what you did though. I am using the exact same stuff so you tag library is a big time saver.

Thanks
Kevin

Heh. Innovation out of laziness, right? I suppose one might say that’s why I wrote the library. :wink:

Glad you find it useful!