On Apr 1, 2004, at 6:39 PM, Collins, Steve wrote:
I can't imagine why this should be the case. Surely any number of applications have dynamic tag library locations like this. Any views or ideas. I'm sort of resigned to setting this non-dynamically, but that would be disappointing.

As hinted elsewhere in this thread, <cfimport> is essentially a compile-time directive and therefore the attributes cannot be dynamic. I'll explain why below...


On Apr 1, 2004, at 6:51 PM, Taco Fleur wrote:
cfimport is a real pain, I figured I could get around this hassle by calling the cfimport tag from the application.cfm when needed (i.e. always relative to the root of the site), but it appears you even need to call it from the page that you will use the functionality.

Yes, <cfimport> only affects the page it is physically in. Again, it's a compile-time directive (like <cfprocessingdirective>) and each physical page requires its own directive to control compilation.


OK, so why is it compile-time?

When you have this in your page:

<cfimport taglib="/somemapping/somedirectory/" prefix="pfx"/>

it tells the CF compiler how to interpret code like this:

<pfx:mytag attr="value">body</pfx:mytag>

Well, that looks like it could still be dynamic, right? OK, what about this:

        <cfimport taglib="/myhtml/" prefix=""/>
        <b>I'm not bold!</b>

If the directory to which /myhtml/ resolves contains a custom tag file b.cfm then this will compile to (the equivalent of):

<cf_b>I'm not bold!</cf_b>

If there is no b.cfm then it will compile to simple code that outputs plain HTML (a bold tag around the text). If you could specify <cfimport> at run-time, CF would have to check every single plain HTML tag at run-time which would make processing very, very slow.

Regards,
Sean


--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to