6 Replies Latest reply on Dec 11, 2010 4:21 PM by chicks14

    new page from template re-names image files

    holly9525

      I created a template in CS4 complete with image files but when I create a blank page from that template, the image files don't render. The img src file name actually changes when I create the new page. Even though all the images are in a folder in the site root, the new

      page says the img src is on my hard drive.

       

      Here's the code for the template I built:

       

      body {

      background-image: url(../images_all/GreenFields_cropped6.jpg)

      }

       

      Here's the code that shows up on the new page:

       

      body {

      background-image: url(file:///Macintosh HD/Users/holly/Documents/Project Two and Three/images_all/GreenFields_cropped6.jpg)

      }

       

      so, of course, the image doesn't show up in the new page.  Any ideas???

       

       

       

      holly9525

        • 1. Re: new page from template re-names image files
          Randy Edmunds Adobe Employee
          background-image: url(file:///Macintosh HD/Users/holly/Documents/Project Two and Three/images_all/GreenFields_cropped6.jpg)

           

          When you create a new file, before saving it the first time, DW doesn't know where you plan to save it, so local absolute paths are used until you save it. These should be converted to relative paths when you save the page the first time.

           

          Is that the correct path to your image? If not, consider using Site-root relative (not page relative) links in Templates so that they do not need to be "converted".

           

          HTH,

          Randy

          • 2. Re: new page from template re-names image files
            holly9525 Level 1

            "When you  create a new file, before saving it the first time, DW doesn't know  where you plan to save it, so local absolute paths are used until you  save it. These should be converted to relative paths when you save the  page the first time."  Unfortunately, that doesn't work. I save the page and the code for my .jpg files still change to the local path.  I've even tried building a page and creating a template from that and it still happens.


            I'm not sure what you mean by "site root relative links."  Can you explain?

            • 3. Re: new page from template re-names image files
              hans-g. Adobe Community Professional & MVP

              Hi,

               

              this entry shows me, that you didn't save your file before you installed your image. Do you remember DW "asked" you to store your file. If you don't do that DW builds a virtual directory like yours

               

              url(file:///Macintosh HD/Users/holly/Documents/Project Two and Three/images_all/GreenFields_cropped6.jpg)

               

               

              You have to correct and specify the correct directory in your source code, or you could repeat the whole process.

               

              Hans-G.

               

              P.S

              You better delete the spaces in your directory names.

              • 4. Re: new page from template re-names image files
                thuy.copeland Level 2

                What Hans-g is talking about is this:

                 

                Go to your main menu. Site > Manage Sites... (select your site)

                Under the Advanced tab, Links relative to: (select the other radio button)

                Picture 2.jpg

                • 5. Re: new page from template re-names image files
                  holly9525 Level 1

                  OK.  Thanks everyone!

                  • 6. Re: new page from template re-names image files
                    chicks14

                    Using Dreamweaver CS4.

                    I create a template with an image URL in an Editable Region, and the same image URL in a non-Editable Region.

                     

                    Create a new page from this template, and look at the source code. Both URL's are shown as File:///C|/Myimagefolder/etc/etc/TheFilename

                     

                    Now Save the page and then look at the source code.

                    The URL in the non-Editable region has been correctly changed to relative location (so this image displays OK). But the URL in the Editable region does not change (and so this image does not display).

                     

                    As far as I can see, this is a little bug in CS4.

                     

                    To work around it I just edit the URL after saving the page.