5 Replies Latest reply on Aug 8, 2007 6:19 AM by rcrane

    Links relative to HTTP address ?

    rcrane
      I'm using DW8 and I'm trying to find a way that DW8 can create links relative to an http address.

      For example, if I move an image in the local site to the html page the html code will show something like the following:

      <img src="/images/image1.gif"

      What I need is that when I move the image it creates a line like the following:

      <img src=" http://mywebsite.com/images/image1.gif"

      I checked everywhere and I cannot find how to do this on DW8. Inside the site settings I have the http address specify but that dopesnt work. That only works for site relative links.

      Any inputs?


        • 1. Re: Links relative to HTTP address ?
          Level 7
          No way, Jose. Sorry....

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


          "rcrane" <webforumsuser@macromedia.com> wrote in message
          news:f9am5s$dhd$1@forums.macromedia.com...
          > I'm using DW8 and I'm trying to find a way that DW8 can create links
          > relative
          > to an http address.
          >
          > For example, if I move an image in the local site to the html page the
          > html
          > code will show something like the following:
          >
          > <img src="/images/image1.gif"
          >
          > What I need is that when I move the image it creates a line like the
          > following:
          >
          > <img src=" http://mywebsite.com/images/image1.gif"
          >
          > I checked everywhere and I cannot find how to do this on DW8. Inside the
          > site
          > settings I have the http address specify but that dopesnt work. That only
          > works
          > for site relative links.
          >
          > Any inputs?
          >
          >
          >
          >


          • 2. Re: Links relative to HTTP address ?
            Level 7
            It is possible to create a Command Extension that would parse your page
            and rewrite all these for you. If you are not familiar with writing
            Extensions yourself, contact me offlist with the details of what you need.

            --

            E. Michael Brandt
            michael at either:

            www.divaHTML.com
            divaGPS : you-are-here menu highlighting
            divaFAQ : FAQ pages with pizazz

            www.valleywebdesigns.com
            JustSo PictureWindow
            JustSo PhotoAlbum

            --


            crane wrote:
            > I'm using DW8 and I'm trying to find a way that DW8 can create links relative
            > to an http address.
            >
            > For example, if I move an image in the local site to the html page the html
            > code will show something like the following:
            >
            > <img src="/images/image1.gif"
            >
            > What I need is that when I move the image it creates a line like the following:
            >
            > <img src=" http://mywebsite.com/images/image1.gif"
            >
            > I checked everywhere and I cannot find how to do this on DW8. Inside the site
            > settings I have the http address specify but that dopesnt work. That only works
            > for site relative links.
            >
            > Any inputs?
            >
            >
            >
            >
            • 3. Re: Links relative to HTTP address ?
              MikeL7 Level 1
              IF (language = PHP) {
              You could do something that might help a little bit.
              First make a site_config.php page and add these variables.
              $site_dir = " http://mywebsite.com/";
              Then make a $image_folder variable:
              $image_folder = "images/";
              Then in your image source code use
              <img src="<?php echo "$site_dir$image_folder"; ?>image1.gif"

              near the top you would put
              require("site_config.php");

              Then you could change the image location and only change the $image_folder variable that is defined once in the site_config.php file. DW wont do it for you but you could set it up so that all your images have the variables for their paths and that would make it easy to change the location of your images

              } else {
              SSI's make maintenance easy so find out how to use them in your language
              }
              • 4. Re: Links relative to HTTP address ?
                Level 7


                <img src="/images/image1.gif"

                IF all the paths are made site root relative, you could do a simple find and
                replace to make them absolute paths.

                You can also do this with the Relativity Extension.

                http://e7x.com/dw/
                install it, open the page in question, and run the relativity extension,
                picking to change to absolute paths.

                --
                Alan
                Adobe Community Expert, dreamweaver

                http://www.adobe.com/communities/experts/



                • 5. Re: Links relative to HTTP address ?
                  rcrane Level 1
                  I found a simple way to do this using the base href:

                  <base href=" http://www.domain.com/">

                  Then on my images can be relative and it will append the relative images path to the base url.