Default file location

Posted on 2005-03-03
Medium Priority
Last Modified: 2013-12-24
I would like to specify a directory where i can keep common files so that i can reference it from any directory in the application, strictly by name, so instead of <cfinclude template="../../../dir/file.ext"> i can simply do <cfinclude template="dir/feil.ext">
Question by:James Rodgers
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 21

Expert Comment

ID: 13450221
jester in that case you need to have mapping of this directory in the application.cfm or coldfusion administrator.
It will do exactly what you need.
LVL 25

Author Comment

by:James Rodgers
ID: 13450341
is ther a special tag used in the application.cfm something like <baseTemplate="myDir">
LVL 21

Accepted Solution

pinaldave earned 500 total points
ID: 13450367
nope... just simple

<cfset application.finebase = 'mydir'>

now you can always use like this....

<cfinclude template="#application.finebase#/myfine.cfm">

you can also map in the CF admin.

LVL 25

Author Comment

by:James Rodgers
ID: 13450627
using what you gave me i came up with this

<cfset application.baseTemplate="http://#cgi.server_name##mid(getDirectoryfrompath(CGI.PATH_INFO),1,find('/',CGI.PATH_INFO,2))#templates/">
LVL 25

Author Comment

by:James Rodgers
ID: 13450809
i actually ended up having to map the directory.

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
What You Need to Know when Searching for a Webhost Provider
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question