Creating path variable for images and Include files
Posted on 2004-04-02
when i needed to create a variable to determine the path, i've did the following:
<!---create rootpath variable on each page-->
<cfset rootpath = "../">
then called it like :
<img src="<cfoutput>#rootPath#</cfoutput>images/spacer.gif" width="780" height="1" alt="" border="0" /><br />
On my sites, the header and foother is often placed in an include file and then called on pages througout the site. So if i set the rootpath in the page that was calling the include file, it would replace #rootPath# with " ../".
This works, however, i wanted to know is there a more efficient way to do this. Can anyone give some help.