Referencing <img> independent of where page it

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'd like to reference an img file (myimage.gif) in such a way that when I
put that code on a page, it doesn't matter where the page it, the code will
"look" in the right place.

Here's the code:

<img border="0" src="../images/arrow_for_breadcrumbs.gif">

Does not work if the page I past it into is at the root directory (such that
/images is a subdirectory).

Any ideas?
 
I mean that if I put the above img code into a page located at the root
directory, the imge doesn't resolve (broken image icon shown).
 
If the image is already in your web, place it on (or in) the page using
Insert | Picture. Once you save the page, the location will be correct,
regardless of where the page is located or the image. And if you move the
image to a different folder, FrontPage will update the references for you.
 
You would have to use a absolute URL to the image, i.e.,
http://www.yourdomainname.com//images/arrow_for_breadcrumbs.gif
In which case FP will not manage the links

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
You got some good suggestions. Best practice (or at best for me)is to
segregate all images that can be use din multiple pages into a single
folder at the root sty at folder images. If the images belong only to a
specific application or folder the you put them in a specific subfolder.
Same for docs or pdfs if you have a lot of them.
For example

/images/
/docs/

/folder1
/folder1/images/

As others said, if you import the image into the fp web in the right
folder and then import the image into a page anywhere in the web and use
fp to locate the file, fp will create the correct relative url. If you
later move the page or the image from within the fp web, fp will adjust
all links and urls.

For typing the img url yourself, for simplicity (to avoid errors):

* use root relative urls (URL with protocol and domain), e.g.,
/images/pic1.gif
/folder1/pic1.gif.

* forward relative URL if pic within a subfolder, e.g.,
for img tag in file /folder1/file1.html pointing to /folder1/images/pic1.gif

use images/pic1.gif.

Is this anologous to any analogies in your book?

...PC
 
More information may help explain my situation.

I am using a VBA program to generate "breadcrumbs' for each page:
Home >> Programs >> this program

Instead of ">>" I'd like to use an image. However, the breadcrumbs.vbs
program is inserting that code automatically into pages in various
directories.

So it could insert into:
root /some_directory/some_page.htm
root/Another_page.htm

etc.

So, Front Page isn't going to be automatically updating the location.

-Clay
 
See Thomas's answer
- use an absolute URL path in your VBA Code

--




|
| More information may help explain my situation.
|
| I am using a VBA program to generate "breadcrumbs' for each page:
| Home >> Programs >> this program
|
| Instead of ">>" I'd like to use an image. However, the breadcrumbs.vbs
| program is inserting that code automatically into pages in various
| directories.
|
| So it could insert into:
| root /some_directory/some_page.htm
| root/Another_page.htm
|
| etc.
|
| So, Front Page isn't going to be automatically updating the location.
|
| -Clay
|
| "Kathleen Anderson [MVP - FrontPage]" wrote:
|
| > If the image is already in your web, place it on (or in) the page using
| > Insert | Picture. Once you save the page, the location will be correct,
| > regardless of where the page is located or the image. And if you move the
| > image to a different folder, FrontPage will update the references for you.
| >
| > --
| > ~ Kathleen Anderson
| > Microsoft MVP - FrontPage
| > Spider Web Woman Designs
| > web: http://www.spiderwebwoman.com/resources/
| >
| >
| > | > > Hi,
| > >
| > > I'd like to reference an img file (myimage.gif) in such a way that when I
| > > put that code on a page, it doesn't matter where the page it, the code
| > > will
| > > "look" in the right place.
| > >
| > > Here's the code:
| > >
| > > <img border="0" src="../images/arrow_for_breadcrumbs.gif">
| > >
| > > Does not work if the page I past it into is at the root directory (such
| > > that
| > > /images is a subdirectory).
| > >
| > > Any ideas?
| >
| >
| >
 
Back
Top