Reply
Visitor
Posts: 3
Registered: ‎12-01-2009

Linking images to individual web pages (html files)

I previously had an operating web site at Adelphia.  The images for individual pages are in "my files" on the Comcast PWP file manager as well as the pages that were operational on Adelphia.

This is an example of the script that formerly worked:

<p align="left"><IMG src="images/worldmp2.gif" width=230 height=139 ALT="World Map">
<IMG src="images/john3_16.gif" width=282 height=139 ALT="John 3:16">
<IMG src="images/people.gif" width=238 height=139 ALT="People"></p>


Another customer's example within Comcast used: (http://home.comcast.net/~bethkatz/ngc4921.html)
<p class=MsoNormal align=center style='margin-top:12.0pt;text-align:center'><img
border=0 width=461 height=472 id="_x0000_i1025" src=ngc4921.jpg><o:smileysilly:></o:smileysilly:></p>

 

worldmp2.gif is one of the images.  How would I script this into comcast's system?

 

 

 

 

 

 

 

Recognized Contributor
Posts: 179
Registered: ‎03-07-2005

Re: Linking images to individual web pages (html files)

The example you gave uses relative adressing for the URL.  That means the full URL of the image is a concatenation of the current page's folder's URL with the contents of the src=parameter.  If the web page was in your root directory, the full URL would become:

 

httl://home.comcast.net/~UserId/images/worldmp2.gif

 

Bethkatz' example shows the web page using the full URL.  The only difference is that using relative addressing makes maintenance easier, especially moving your web site to a different hosting provider.

 

I assume you have a problem and can't get something to work but I'm not sure what your problem is.  If you have a web page up and running, then trying both approaches would be a simple thing to do.

 

The big thing being left out is whether you're creating your own web pages or using Comcast's PWP building tools (which we do not recommend).

 

Cheers, Neil.

Web Page Expert
BethKatz
Posts: 6,138
Registered: ‎11-14-2006

Re: Linking images to individual web pages (html files)

If the page you are building is at the same level of your file system as the images folder that contains wordlmp2.gif, you use the same form you were using at Adelphia with the relative address of images/worldmp2.gif.

 

I use relative addresses all over the place, but sometimes I use hardcoded references for images and pages that may be external to the pages I'm building. These pages built with iWeb have a separate folder for each page:

http://home.comcast.net/~bethkatz/Instruments

Although the image is at http://home.comcast.net/~bethkatz/Instruments/Main_files/shapeimage_2.jpg, in the code for Main.html, it is referred to as Main_files/shapeimage_2.jpg

 

As Neil noted, we need to know if you are using Comcast's page-building tools (in your case I wouldn't because you already have some pages) or something else. If something else, what?

 

Also, be aware that case matters. images/worldmp2.gif is not the same as Images/worldmp2.GIF and if you post the URL of the page you're building, we can often figure out the problem.

 

 

Visitor
Posts: 3
Registered: ‎12-01-2009

Re: Linking images to individual web pages (html files)

I am responding to my own post.  I haven't tried it yet, but I suspect that the problem was that I do not have images in a separate sub-directory on Comcast, whereas formerly on Adelphia they were in a  /images subdirectory.  I will try to correct this by removing "/images" from the script. 

 

Bronze Problem Solver
Posts: 5,958
Registered: ‎03-12-2004

Re: Linking images to individual web pages (html files)


jefferson1935 wrote:

I am responding to my own post.  I haven't tried it yet, but I suspect that the problem was that I do not have images in a separate sub-directory on Comcast, whereas formerly on Adelphia they were in a  /images subdirectory.  I will try to correct this by removing "/images" from the script. 

 


Or create an images directory and put your images there.

Visitor
Posts: 3
Registered: ‎12-01-2009

Re: Linking images to individual web pages (html files)

Reply to fishman: While removing "/images" was part of the solution, I did need to add http://home.comcast.net/~myname to the script, i.e.,

<IMG src="http://home.comcast.net/myname/people.gif" width=238 height=139 ALT="People">

 

I don't know if there is another solution or if the approach I took was the fastest for load time.  I am open to other suggestions. 

Bronze Problem Solver
Posts: 5,958
Registered: ‎03-12-2004

Re: Linking images to individual web pages (html files)

[ Edited ]

jefferson1935 wrote:

Reply to fishman: While removing "/images" was part of the solution, I did need to add http://home.comcast.net/~myname to the script, i.e.,

<IMG src="http://home.comcast.net/myname/people.gif" width=238 height=139 ALT="People">

 

I don't know if there is another solution or if the approach I took was the fastest for load time.  I am open to other suggestions. 


It is always good coding practice to use relative addressing rather than absolute addressing whenever possible. Your tag could have been written <IMG src="people.gif" width=238 height=139 ALT="People"> because the image is in your root directory. If the image was in a directoyr named "images" your tag could look like <IMG src="images/people.gif" width=238 height=139 ALT="People">

Message Edited by FishMan on 12-04-2009 09:49 AM