Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Setting up directory structures

Posted on 2001-06-15
6
Medium Priority
?
203 Views
Last Modified: 2013-12-24
Well, heres an easy question (i think).

Um.. it's all a bit of a mess really now..
 
1)I have a file called global_variables.cfm in www.mysite.com/includes/
this file is linked to from my application.cfm file found in the root of the website.
it contains these lines:
 
<CFSET application.root_path="../">
<CFSET application.image_path="#application.root_path#navigation/">
<CFSET application.includes="#application.image_path#includes/">
 
2)my main page is made up of 4 include files, inc_1pageheader.cfm, inc_2globalqueries.cfm etc...
these include files are in the www.mysite.com/includes/ folder also.
the includes display the main navigation, with images and stylesheets.
here is the example from an include:
 
<link rel="stylesheet" href="#application.images#stylesheet.css">
<LINK rel="SHORTCUT ICON" href="#application.images#favicon.ico">
 
3)I have a file called index.cfm  which is in www.mysite.com/ (the root dir)
this uses <cfinclude> to compile up the page design, and also displays the main "news" scrren on my page
 
 
4)all the images for the site are in : www.mysite.com/navigation

 
OKAY, now the page compiles fine, and it finds all the include pages fine. except it can't find the images. however
there is one exception to this. it manages to find this image found on the inc_4restofpage.cfm:
 
<img src="#application.images#/icon-bullet.gif" width="9" height="9">

But NOT this one:
<img src="#application.images#/1x1.gif" width="100" height="15">
 
and it's not picking up the above stylesheet either.
 
 

It's confusing me.. as this should be EASY!
0
Comment
Question by:M_Corkish
[X]
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
  • 3
6 Comments
 
LVL 4

Expert Comment

by:CF_Spike
ID: 6194594
Try changing the application.rootpath to "/" instead of "../".

Spike
0
 

Author Comment

by:M_Corkish
ID: 6194616
unfortunately i tried that, and it didn't work.

to simplify perhaps.... how does everyone else do this?   so that the includes, and images folder is available to all pages..nomatter how deep they may be down the directory structure.

C.
0
 
LVL 4

Expert Comment

by:CF_Spike
ID: 6194631
I do pretty much the same as you.

Have you tried looking at the source code of the page where the images aren't being displayed?

Spike
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 

Author Comment

by:M_Corkish
ID: 6194696
yeah, and *some* of them work... thats why it's so odd..

basically on the 3rd include file, there are like 4 different images mentioned on that include. 1 of them loads... the others don't... the <img src="blah"> is correct.. so it's real odd.  it just doesn't seem to want to convert the #application.images# to it's proper path.

It ends up leaving it in, ie:

<img src="#imagepath#/1x1.gif" width="100" height="6">

where as the line below it, it does this:

<img src="/mischaiscool/navigation/icon-bullet.gif" width="9" height="9">


which of course works... hmmm.. if i right click the properties on the working image, it's fine.. but heres something interesting... when i click the propterties of the not working image... it says this:

http://127.0.0.1/mysite/index.cfm#imagepath#/1x1.gif

which is most certainly not what the source is telling it to do.... it appears to be sticking in the index.cfm file in the image url..


hmmmm
0
 
LVL 4

Accepted Solution

by:
CF_Spike earned 200 total points
ID: 6194716
Are you sure that the code is all wrapped in cfoutput tags. That is the only reason I can think of for this behaviour.

Spike
0
 

Author Comment

by:M_Corkish
ID: 6194941
dude! that was essentially it.. i guess i had assumed i could use those without cfoutput!  doh..

Thanks.. this had been bothering me for a while....

Why is it we can't ever see stupid things like this?

C.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

618 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