Hello.
I am having problems referring to a file from a layout template. The
relevant directory structure is as follows:
[fooapp]
|
|---[common]
| |
| |---[graphics]
| | |
| | |---common.jpg
| |
| |---[layouts]
| | |
| | |---layBasic.cfm
| |
| |---[styles]
| |
| |---common.css
|
|---fbx_Layouts.cfm
|---fbx_Settings.cfm
The 'common' subdirectory is meant to contain resources that are shared
by the entire application, e.g. the global stylesheet, the basic layout,
graphics, etc. It is not defined as a circuit in the fbx_Circuits.cfm
file though, since it is only a repository for files.
In the fbx_Layouts.cfm file, I make the fusebox.layoutFile variable
point to layBasic.cfm, making sure to inform the correct directory
(common/layouts) too. This is working fine.
* Relevant contents of fbx_Layouts.cfm:
<cfset fusebox.layoutFile = "layBasic.cfm">
<cfset fusebox.layoutDir = "common/layouts/">
In the fbx_Settings.cfm file I set some variables to refer to the common
directories for graphics and styles.
* Relevant contents of fbx_Settings.cfm:
<cfparam name="variables.commonStylesDirectory"
default="common/styles/">
<cfparam name="variables.commonGraphicsDirectory"
default="common/graphics/">
In the layBasic.cfm file, I want to include the contents of the global
stylesheet (common/styles/common.css), but I would like to make use of
the Fusebox API to find its path, as opposed to entering it manually or
having to create my own mapping. I have tried many different approaches.
Here is the relevant code from layBasic.cfm:
<style type="text/css">
<cfinclude
template="#fusebox.rootPath##variables.commonStylesDirectory#common.css">
</style>
This is not working; fusebox.rootPath is always returning blank, as is
fusebox.currentPath. I guess that should indicate that, as far as the
core file is concerned, we are already at the application's root. But if
that was the case, then "common/styles/common.css" should be a proper
path. However, I have found that I must use "../styles/common.css" to
get it to work. What is going on here?
My tentative solution has been to define yet another variable in my
fbx_Settings.cfm file, which relies on the CF server's mapping.
<cfparam name="variables.mappedRoot" default="/intranet/fooapp/">
And then use it like:
<style type="text/css">
<cfinclude
template="#variables.mappedRoot##variables.commonStylesDirectory#common.css">
</style>
This works, but as I said before, I would like to make use of the
Fusebox API, which I thought should be possible. What am I missing?
Thank you,
--
Ney Andr� de Mello Zunino
Media and Technology Laboratory
Campus Computing Centre
United Nations University
P.S.: Please, let me know case more details are needed.
==^================================================================
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]
T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================