Problems with HTML includes

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Problems with HTML includes

    Hi There,
    I have a really annoying problem which I'm sure there is a simple solution to
    but my mind has gone blank. Basically I have a website which uses include files
    to store content which appears on every page (menus, header, footer, etc). I am
    not using a Dreamweaver template for this because its likely that those editing
    the website will not have Dreamweaver.

    The problem is that the various pages of the site are in many different
    folders, and some in sub folders to that. Therefore the links to images or
    other pages contained in the include files do not work because the reference
    varies depending on the location of the webpage itself. The point in creating
    include files this way was to ensure that changes to menus, etc only involve
    changes to one file so I don't really wnat to have different includes in
    different sub folders just so the images and links are valid.

    I seem to remember, back in the days when I studied HTML that references can
    be made starting from the root folder of the website. Can someone remind me of
    how to do this? I know that ../ will reference from the previous folder and
    .../../ from two folders down, but as I mentioned different pages sharing the
    same includes are in different folders and subfolders so this is no good either.

    I suppose I could always put the whole web address in the reference (e.g.
    [url]http://www.mydomain.com/[/url] general/images/image1.jpg) but again this is
    onconvenient when working offline. Can anyone help me out?

    asprinwizard Guest

  2. Similar Questions and Discussions

    1. previewing html problems
      I have question regarding previewing dreamweaver html page in my local browser. I have created several pages with the same look/template. I will...
    2. Help me, HTML Text problems
      :confused; In my HTML web documents, although the fonts and sizes I apply to different pieces of text show up on the website document, when I...
    3. Php includes? An html file?
      Hi all, I'm working on table that has to be updated quarterly by a client using either Contribute or DW. The table rotates each week and I have...
    4. Problems Editing Page w/ CF Includes
      My organization has recently started using Contribute. I designed and developed our current site http://www.cohpa.ucf.edu and I'm having trouble...
    5. UD4 - Add Page HTML problems
      I want to be able to format the text within the database. If I add via database, all is good and formatting appears on website. If I try to do the...
  3. #2

    Default Re: Problems with HTML includes

    Just a slash'll do ya:
    img src="/images/mypicture.gif"

    The leading slash makes it a root-relative path.


    "asprinwizard" <webforumsuser@macromedia.com> wrote in message
    news:dkagib$aug$1@forums.macromedia.com...
    > Hi There,
    > I have a really annoying problem which I'm sure there is a simple solution
    > to
    > but my mind has gone blank. Basically I have a website which uses include
    > files
    > to store content which appears on every page (menus, header, footer, etc).
    > I am
    > not using a Dreamweaver template for this because its likely that those
    > editing
    > the website will not have Dreamweaver.
    >
    > The problem is that the various pages of the site are in many different
    > folders, and some in sub folders to that. Therefore the links to images or
    > other pages contained in the include files do not work because the
    > reference
    > varies depending on the location of the webpage itself. The point in
    > creating
    > include files this way was to ensure that changes to menus, etc only
    > involve
    > changes to one file so I don't really wnat to have different includes in
    > different sub folders just so the images and links are valid.
    >
    > I seem to remember, back in the days when I studied HTML that references
    > can
    > be made starting from the root folder of the website. Can someone remind
    > me of
    > how to do this? I know that ../ will reference from the previous folder
    > and
    > ../../ from two folders down, but as I mentioned different pages sharing
    > the
    > same includes are in different folders and subfolders so this is no good
    > either.
    >
    > I suppose I could always put the whole web address in the reference (e.g.
    > [url]http://www.mydomain.com/[/url] general/images/image1.jpg) but again this is
    > onconvenient when working offline. Can anyone help me out?
    >

    Lionstone Guest

  4. #3

    Default Re: Problems with HTML includes

    I knew it something simple. many thanks.
    asprinwizard Guest

  5. #4

    Default Re: Problems with HTML includes

    Alright I thought this was solved. It seems not. Sure all the images display in
    Dreamweaver Design mode, even on the include files themselves, but when I
    preview in browser all the images are red x's. What the hell is going on
    here!!!!?? I right click on the red x on properties and see that the part is
    correct.

    These are PHP pages running on my local testing server: localhost. Why can I
    not see the images? Clearly the includes are being passed because all the text
    is displayed on the page. Why no images? Can anyone help?

    asprinwizard Guest

  6. #5

    Default Re: Problems with HTML includes

    Post a link to the page that is missing the images, please.

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "asprinwizard" <webforumsuser@macromedia.com> wrote in message
    news:dkargc$qu6$1@forums.macromedia.com...
    > Alright I thought this was solved. It seems not. Sure all the images
    > display in
    > Dreamweaver Design mode, even on the include files themselves, but when I
    > preview in browser all the images are red x's. What the hell is going on
    > here!!!!?? I right click on the red x on properties and see that the part
    > is
    > correct.
    >
    > These are PHP pages running on my local testing server: localhost. Why can
    > I
    > not see the images? Clearly the includes are being passed because all the
    > text
    > is displayed on the page. Why no images? Can anyone help?
    >

    Murray *TMM* Guest

  7. #6

    Default Re: Problems with HTML includes

    It is not online yet unfortunately. I have been running it on my testing
    server. I have temporarily uploaded it here:
    [url]http://www.skolars.com/template2.php[/url]
    and it seems to work fine (the one missing image has not been uploaded). Any
    clue then as to why it doesn't work on localhost?

    asprinwizard Guest

  8. #7

    Default Re: Problems with HTML includes

    You wont be able to see the php on your local server unless you have installed php and configured it on there.
    Greybeard_Web_Designs Guest

  9. #8

    Default Re: Problems with HTML includes

    I have an Apache server with PHP 5.04 installed on two of my machines. These includes don't work on either. Is there something I need to configure?
    asprinwizard Guest

  10. #9

    Default Re: Problems with HTML includes

    Ok, I think I know what the issue is here. My local testing server is
    [url]http://localhost/[/url] and all the sites I design are in subfolders to this domain.
    The include files reference from the root of localhost but my website root is
    localhost/RLI. However when I publish the site online obviously it will be in
    the root of the domain and the images show up ok.

    The result therefore is that until the site goes online no images will display
    properly if they are in include files, unless I go through all the files prior
    to publishing and change the references which is very inconvenient.

    Is there anyway to create a subdomain on a local server. I have setup the
    testing server in Dreamweaver to [url]http://localhost/RLI[/url] but this doesn't seem to
    have an effect. Any suggestions?

    asprinwizard Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139