8 Replies Latest reply on Sep 9, 2008 1:45 PM by Newsgroup_User

    Forcing document-relative links in templates

    Jason Lampitt
      Does anyone know if it's possible to create a relative link to a document (like a CSS file) in a DWT that lives above/outside the site folder and make it so Dreamweaver does NOT rewrite just that particular path?

      For example, in my template, I want to link to a file in a common library that is above the project directory. The intention is to have several projects share a common CSS file. The path looks something like the following from the Templates directory in my site:

      <link href="../../library/css/layout_guide.css" />

      When I create a new document from the template, it rewrites the href as something like:

      file://///d:/Projects/library/css/layout_guide.css


      I know all the how's and why's of what's going on here. I thought someone might have a clever work-around to essentially "fix" the path of this one specific link. I suppose I could utilize a specific http or network address to the library's ultimate location, but I thought I'd throw the question out there and see what I catch.
        • 1. Re: Forcing document-relative links in templates
          Level 7
          I seem to remember that there is a way to do this using a file reference in
          an include file, but I can't find the article that described this right now.
          If I do find it, I'll let you know.

          "jasonLampitt" <webforumsuser@macromedia.com> wrote in message
          news:ga6del$lnf$1@forums.macromedia.com...
          > Does anyone know if it's possible to create a relative link to a document
          > (like
          > a CSS file) in a DWT that lives above/outside the site folder and make it
          > so
          > Dreamweaver does NOT rewrite just that particular path?
          >
          > For example, in my template, I want to link to a file in a common library
          > that
          > is above the project directory. The intention is to have several projects
          > share
          > a common CSS file. The path looks something like the following from the
          > Templates directory in my site:
          >
          > <link href="../../library/css/layout_guide.css" />
          >
          > When I create a new document from the template, it rewrites the href as
          > something like:
          >
          > file://///d:/Projects/library/css/layout_guide.css
          >
          >
          > I know all the how's and why's of what's going on here. I thought someone
          > might have a clever work-around to essentially "fix" the path of this one
          > specific link. I suppose I could utilize a specific http or network
          > address to
          > the library's ultimate location, but I thought I'd throw the question out
          > there
          > and see what I catch.
          >


          • 2. Re: Forcing document-relative links in templates
            Level 7
            > The intention is to have several projects share
            > a common CSS file

            Honestly, it's not worth the hassle. But you CAN, in the Site definition,
            specify that the Template NOT rewrite document relative links. You cannot,
            however, specify that a particular link not be rewritten using this method.
            Alternatively, you could make the specific link this way -

            <link href=@@("../../library/css/layout_guide.css")@@ />

            in which case the Template engine will not manage that link.

            --
            Murray --- ICQ 71997575
            Adobe Community Expert
            (If you *MUST* email me, don't LAUGH when you do so!)
            ==================
            http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
            http://www.dwfaq.com - DW FAQs, Tutorials & Resources
            ==================


            "jasonLampitt" <webforumsuser@macromedia.com> wrote in message
            news:ga6del$lnf$1@forums.macromedia.com...
            > Does anyone know if it's possible to create a relative link to a document
            > (like
            > a CSS file) in a DWT that lives above/outside the site folder and make it
            > so
            > Dreamweaver does NOT rewrite just that particular path?
            >
            > For example, in my template, I want to link to a file in a common library
            > that
            > is above the project directory. The intention is to have several projects
            > share
            > a common CSS file. The path looks something like the following from the
            > Templates directory in my site:
            >
            > <link href="../../library/css/layout_guide.css" />
            >
            > When I create a new document from the template, it rewrites the href as
            > something like:
            >
            > file://///d:/Projects/library/css/layout_guide.css
            >
            >
            > I know all the how's and why's of what's going on here. I thought someone
            > might have a clever work-around to essentially "fix" the path of this one
            > specific link. I suppose I could utilize a specific http or network
            > address to
            > the library's ultimate location, but I thought I'd throw the question out
            > there
            > and see what I catch.
            >

            • 3. Re: Forcing document-relative links in templates
              Level 7


              > lives above/outside the site folder

              If the file is outside of the site folder, then it's not IN the site and
              there is no way to make a relative path to it.

              --
              Alan
              Adobe Community Expert, dreamweaver

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



              • 4. Re: Forcing document-relative links in templates
                Level 7
                But it could be IN the site on the remote server, doncha know? That's why
                he doesn't want to rewrite the link. Of course, none of the rules contained
                in that file will ever be expressed while working in this site in DW, which
                could be overcome by also using a DT stylesheet, but now, your attempt to
                simplify things has grown into a big, troublesome, wart.

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                ==================


                "Alan" <please_dont_mail_me@example.com> wrote in message
                news:C4EC5053.30C56F%please_dont_mail_me@example.com...
                >
                >
                >> lives above/outside the site folder
                >
                > If the file is outside of the site folder, then it's not IN the site and
                > there is no way to make a relative path to it.
                >
                > --
                > Alan
                > Adobe Community Expert, dreamweaver
                >
                > http://www.adobe.com/communities/experts/
                >
                >
                >

                • 5. Forcing document-relative links in templates
                  Jason Lampitt Level 1
                  Of course! How could I have forgotten!

                  Thanks for jogging my memory.

                  For the benefit of others, look up "Template expression language" in Dreamweaver's help.
                  • 6. Re: Forcing document-relative links in templates
                    Level 7
                    Good luck. This seems like a bit of a windmill to me, though.

                    --
                    Murray --- ICQ 71997575
                    Adobe Community Expert
                    (If you *MUST* email me, don't LAUGH when you do so!)
                    ==================
                    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                    ==================


                    "jasonLampitt" <webforumsuser@macromedia.com> wrote in message
                    news:ga6ltb$2bg$1@forums.macromedia.com...
                    > Of course! How could I have forgotten!
                    >
                    > Thanks for jogging my memory.

                    • 7. Re: Forcing document-relative links in templates
                      Jason Lampitt Level 1
                      Not at all... trust me, the template expressions are exactly what I needed. Thanks again!
                      • 8. Re: Forcing document-relative links in templates
                        Level 7
                        Good luck!

                        --
                        Murray --- ICQ 71997575
                        Adobe Community Expert
                        (If you *MUST* email me, don't LAUGH when you do so!)
                        ==================
                        http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                        http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                        ==================


                        "jasonLampitt" <webforumsuser@macromedia.com> wrote in message
                        news:ga6n5p$3og$1@forums.macromedia.com...
                        > Not at all... trust me, the template expressions are exactly what I
                        > needed. Thanks again!