Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

templates do not resolve images/picture.gif - Please Help! 2

Status
Not open for further replies.

josel

Programmer
Oct 16, 2001
716
US
Hello every one!

I am very very new - in fact, I'm just reading "ColdFusion Essentials" as my intro to what appears to be a great application.

I hit a brick wall and can't get around to it. I created a directory c:\inetpub\ In this directory, I created two other directories, data and images. Data is where I keep ACCESS files and images is where I've placed images. I am able to access the tables and show information on screen but templates using

<a href=&quot;&quot;>
<img scr=&quot;images/MyLogo.gif&quot; Alt=&quot;My Company Logo&quot; border=&quot;0&quot;>
</a>

are not showing the pictures at all. What am I missing?

Thank you all in advance;

Jose Lerebours

If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Is the images folder in the directory as your pages?

EG:

images (folder)
data (folder)
page1.cfm (file)
page2.cfm (file)

If this is not the case you need to change the path to the images. possibly /images/myLogo.gif DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
DeZiner,

Thanks for replying. Both folders data and images are within cfessential. I have tried the / and nothing.

Is there something I need to do in studio or server to let them know about root directory, path, etc?

I just love it when simple things turn complicated :)

Regards;

josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Where is the cfm page located in the folder structure that has the <img> tag, and is that template being used in another template either by CFMODULE or CFINCLUDE? - tleish
 
I assume this is just a typo, but your code above has <img scr=, which should be <img src=.
 
<tleish>

Given c:\inetpub\ as the obsulte path,

The cfm files are located in a directory named cfessential. Within this directory I have two other directories, data and images. GIFs referred to in templates are in images directory.

YES - I am using the <img scr= ...> command within a &quot;header.cfm&quot; template (I think this is very neat!) which is called using cfinclude. Am I violating a rule by doing this?

</tleish>


<profwannabe>

Sorry about the typo, the syntax is correct in my cfm templates.

</profwannabe>

Thank you both for replying!


josel If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
I'm not sure this is the problem, but this is one guess at what could be wrong. Make sure you look at the path of the [COLOR=000080]<img>[/color] that it is relative to the website and not necesarily relative to the CF Templates.

For example, say I have the following files:

/index.cfm
/CFEssential/header.cfm
/CFEssential/images/MyLogo.gif

The following will not display the image correctly viewing index.cfm:

=== START CODE EXAMPLE ===
[COLOR=666666]<!--- /CFEssential/header.cfm --->[/color]
[COLOR=000080]<img scr=&quot;images/MyLogo.gif&quot;>[/color]

[COLOR=666666]<!--- /index.cfm --->[/color]
<cfinclude template=&quot;CFEssential/header.cfm&quot;>
=== END CODE EXAMPLE ===

This will display correctly:

=== START CODE EXAMPLE ===
[COLOR=666666]<!--- /CFEssential/header.cfm --->[/color]
[COLOR=000080]<img scr=&quot;images/CFEssential/MyLogo.gif&quot;>[/color]

[COLOR=666666]<!--- /index.cfm --->[/color]
<cfinclude template=&quot;CFEssential/header.cfm&quot;>
=== END CODE EXAMPLE ===

The reason is because the browser only recognizes the link to the image from the final file. Top better understand this, you would view the source the file is creating in the browser once the CF has been parsed. - tleish
 
As embarrazing as it might be, I must confess that I had both, syntax &quot;scr&quot; instead of &quot;src&quot; and directory tree problems.

I looked at the code very closely again and again and was not able to notice I had <img scr= not <img src=; even after profwannab brought it to my attention.

Viewing the source code produced by page and highlighting every <img src= instance, I then was able to spot my syntax problems.

As a newbie, I guess I should simplify writing and break lines of code into multiple lines for easy reading and follow through :)

I want to thank all of you for helping me with this matter. Members like you make this forum a place of choice to learn tricks of the trade thus simplifying learning curve.

Regards;

Jose Lerebours If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top