Results 1 to 4 of 4

Thread: Include file and images

  1. #1
    Join Date
    Aug 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Include file and images

    i am having the hardest time adding images into an include file. It just will not show no matter what path i put absolute or root.

    i have a main default page that is being controlled by a template in the Templates folder. Then i have an includes folder that the template is calling in.

    what am i doing wrong?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you are using the absolute path, you have either constructed an invalid or otherwise invisible image tag, or the image isn't where the absolute path indicates.

    Remember also that for paths and filenames to be correct they much match exactly, upper and lower case matter.

    If you want more help:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, for example, the absolute path to PRNS-inside-prns.jpg is:

    Code:
    http://sanjoseca.gov/prns/PRNS-inside-prns.jpg
    But on the include page it is listed as (in the stylesheet), which is not its relative location to the includes page but may be to the page it is included on, but I don't think you want it showing as background anyway (a background image requires layout dimensions for the element that it is the background for equal to the image's dimensions):

    Code:
    #inside {background-image:url(PRNS-inside-prns.jpg);
    and (in the markup on the includes page):

    Code:
    <img src="../PRNS-inside-prns.jpg"
    Which is accurate relatively for the includes page's directory, but not for the prns directory where your page that has the include on it is located. I see also that you have lowsrc and longdesc attributes with various ways of listing the image. Those two are basically meaningless when it comes to fetching the file, but if you want to use them, that's OK with me. In any case, every place that it is listed where you actually want it to show up should use its absolute path:

    Code:
    http://sanjoseca.gov/prns/PRNS-inside-prns.jpg
    Last edited by jscheuer1; 01-31-2009 at 02:53 AM. Reason: accuracy about the background image
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •