This is a problem I've encountered too and a real pain. I've just used
attribute="#GetDirectoryFromPath(GetCurrentTemplatePath())#\foo.cfm"
which is rather unsightly.
I'd like to see that UDF!
Re your question: I don't think so.
Regards,
Matthew Walker
/*
Cabbage Tree Creative Ltd
Christchurch - New Zealand
http://www.matthewwalker.net.nz/
http://www.cabbagetree.co.nz/
*/
-----Original Message-----
From: heirophant mm [mailto:[EMAIL PROTECTED]]
Sent: Friday, 12 April 2002 2:11 p.m.
To: CF-Talk
Subject: CFINCLUDE tag and relative paths
I have a display template, called as a custom tag through CFMODULE. The
caller tags pass it an attribute called "navigation", which is the path
of a navigation template to display. The custom tag displays it using
<cfdisplay template="#attributes.navigation#">.
I want the caller to be able to pass a path relative from itself (for
ease of use) - so the value you pass for the "navigation" attribute
would be the same as the value that a CFINCLUDE right inside the caller
template would use.
However, since the display template is in a different folder, just doing
<cfinclude template="#attributes.navigation#"> does not work, since it
expects the path to be relative from the current template, NOT the
caller template.
I wrote some UDFs that convert the value of attributes.navation so the
path is instead relative to the display template, allowing the CFINCLUDE
tag to work correctly. This solution is not very elegant, though. Nor is
it efficient.
Am I missing an easier way to do this? To summarize, I want a CFINCLUDE
tag to correctly find a path that is relative to the caller template,
instead of the current [custom tag] template.
Note: For reasons unknown to me, we aren't allowed to use the Custom
Tags folder on our server. So this display template I'm talking about is
actually below the wwwroot folder. I don't know if that makes any
difference in my problem.
This brings me to my second question: Do custom tags actually in the
Custom Tags folder behave differently concerning tags such as CFINCLUDE?
In this case, would the CFINCLUDE tag look for a template relative to
the caller template instead?
-------------------
Mike Mertsock
Web Applications Programmer
Alfred University
[EMAIL PROTECTED]
See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_02
0201/splash.asp
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists