16 Replies Latest reply on Aug 11, 2007 6:13 PM by dale99

    Question about virtual includes

    dale99 Level 1
      I’m new to DW and I’m trying to create a server side include. My hosting account is on an apache server and from what I’ve seen, I’m suppose to create a virtual (compared to file) include. So I create the include, but when I try to convert from file to virtual, it gives me the error message “The URL cannot be converted to a valid include of type “virtual”.

      I have another hosting account that isn’t on an apache server and I was able to easily create the include (file type include) and it works on the site. I used a .shtml include file with all the html, head, and body tags removed. Any ideas on what I might be doing wrong or what I have to do to get this working right? Thanks for any help.

      Dale
        • 1. Re: Question about virtual includes
          Level 7
          The parent file has the shtm(l) name. The include file (the file being
          included in the parent file) can have ANY extension.

          --
          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
          ==================


          "dale99" <webforumsuser@macromedia.com> wrote in message
          news:f9iju8$329$1@forums.macromedia.com...
          > I?m new to DW and I?m trying to create a server side include. My hosting
          > account is on an apache server and from what I?ve seen, I?m suppose to
          > create a
          > virtual (compared to file) include. So I create the include, but when I
          > try to
          > convert from file to virtual, it gives me the error message ?The URL
          > cannot be
          > converted to a valid include of type ?virtual?.
          >
          > I have another hosting account that isn?t on an apache server and I was
          > able
          > to easily create the include (file type include) and it works on the site.
          > I
          > used a .shtml include file with all the html, head, and body tags removed.
          > Any
          > ideas on what I might be doing wrong or what I have to do to get this
          > working
          > right? Thanks for any help.
          >
          > Dale
          >
          >


          • 2. Re: Question about virtual includes
            Level 7
            Use of Server Side Includes: http://www.freewebmasterhelp.com/tutorials/ssi

            1) I would suggest doing the date/time test on an shtml page to confirm your
            server supports SSIs.

            2) When you say converting to virtual(?) I don't know what that means. I
            usually insert an SSI into a page in code view, then hand type "virtual"
            where "filename" appears. Is that what you mean?


            --Nancy O.
            Alt-Web Design & Publishing
            www.alt-web.com




            "dale99" <webforumsuser@macromedia.com> wrote in message
            news:f9iju8$329$1@forums.macromedia.com...
            > I?m new to DW and I?m trying to create a server side include. My hosting
            > account is on an apache server and from what I?ve seen, I?m suppose to
            create a
            > virtual (compared to file) include. So I create the include, but when I
            try to
            > convert from file to virtual, it gives me the error message ?The URL
            cannot be
            > converted to a valid include of type ?virtual?.
            >
            > I have another hosting account that isn?t on an apache server and I was
            able
            > to easily create the include (file type include) and it works on the site.
            I
            > used a .shtml include file with all the html, head, and body tags removed.
            Any
            > ideas on what I might be doing wrong or what I have to do to get this
            working
            > right? Thanks for any help.
            >
            > Dale
            >
            >


            • 3. Re: Question about virtual includes
              dale99 Level 1
              Thanks - like I said, I'm new to DW and server side includes. Still amazes me how could make such a mistake. Thanks again.
              • 4. Re: Question about virtual includes
                Level 7
                <!--#include virtual="/whatever.monkeybutt" -->

                --
                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
                ==================


                "Nancy O" <nancyoshea1@NOSPAMverizon.net> wrote in message
                news:f9ip07$8gm$1@forums.macromedia.com...
                > Use of Server Side Includes:
                > http://www.freewebmasterhelp.com/tutorials/ssi
                >
                > 1) I would suggest doing the date/time test on an shtml page to confirm
                > your
                > server supports SSIs.
                >
                > 2) When you say converting to virtual(?) I don't know what that means.
                > I
                > usually insert an SSI into a page in code view, then hand type "virtual"
                > where "filename" appears. Is that what you mean?
                >
                >
                > --Nancy O.
                > Alt-Web Design & Publishing
                > www.alt-web.com
                >
                >
                >
                >
                > "dale99" <webforumsuser@macromedia.com> wrote in message
                > news:f9iju8$329$1@forums.macromedia.com...
                >> I?m new to DW and I?m trying to create a server side include. My hosting
                >> account is on an apache server and from what I?ve seen, I?m suppose to
                > create a
                >> virtual (compared to file) include. So I create the include, but when I
                > try to
                >> convert from file to virtual, it gives me the error message ?The URL
                > cannot be
                >> converted to a valid include of type ?virtual?.
                >>
                >> I have another hosting account that isn?t on an apache server and I was
                > able
                >> to easily create the include (file type include) and it works on the
                >> site.
                > I
                >> used a .shtml include file with all the html, head, and body tags
                >> removed.
                > Any
                >> ideas on what I might be doing wrong or what I have to do to get this
                > working
                >> right? Thanks for any help.
                >>
                >> Dale
                >>
                >>
                >
                >


                • 5. Re: Question about virtual includes
                  dale99 Level 1
                  Oops - the include is showing up on my live site, but I still can't change it from file to virtual type. I'm still getting the error message that I stated above. Any ideas on how to do this?

                  I don't have the site I'm editing created as a DW site, I'm just editing and saving to my server with an FTP program. Is it nessary to create the DW site for virtual type includes to work?

                  Also, our site is on an apache server. Although the includes are showing now, is it still a good idea to change them from file type to virtual type once I can figure out how to do this, or if they are working now, can I exect them to always work?
                  • 6. Re: Question about virtual includes
                    Level 7
                    Let's see the page, please.

                    > I don't have the site I'm editing created as a DW site, I'm just editing
                    > and
                    > saving to my server with an FTP program. Is it nessary to create the DW
                    > site
                    > for virtual type includes to work?

                    It's necessary to work within a DW defined site for any of your links to
                    work and to be properly formatted.

                    > Also, our site is on an apache server. Although the includes are showing
                    > now,
                    > is it still a good idea to change them from file type to virtual type

                    Why do you feel like you need virtual includes?

                    --
                    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
                    ==================


                    "dale99" <webforumsuser@macromedia.com> wrote in message
                    news:f9iskb$c4s$1@forums.macromedia.com...
                    > Oops - the include is showing up on my live site, but I still can't change
                    > it
                    > from file to virtual type. I'm still getting the error message that I
                    > stated
                    > above. Any ideas on how to do this?
                    >
                    > I don't have the site I'm editing created as a DW site, I'm just editing
                    > and
                    > saving to my server with an FTP program. Is it nessary to create the DW
                    > site
                    > for virtual type includes to work?
                    >
                    > Also, our site is on an apache server. Although the includes are showing
                    > now,
                    > is it still a good idea to change them from file type to virtual type once
                    > I
                    > can figure out how to do this, or if they are working now, can I exect
                    > them to
                    > always work?
                    >


                    • 7. Re: Question about virtual includes
                      dale99 Level 1
                      Here’s the test page:
                      http://www.lifeleap.org/test2.shtml

                      Here is the include page that goes with this test page:
                      http://www.lifeleap.org/include1.html


                      The include does seem to be working. As Nancy O mentioned earlier, yes, this is what I mean by virtual include. I can make the change into the code, but DW won’t let me change it in the Properties (this is where I get the error message when I try to change the include from File to Virtual).

                      The whole reason I thought I needed to use virtual includes is because I saw this help file:
                      http://livedocs.adobe.com/dreamweaver/8/using/wwhelp/wwhimpl/common/html/wwhelp.htm?contex t=LiveDocs_Parts&file=24_cod15.htm

                      It says to use virtual includes if you have an apache server. I have an apache server and am wondering if File includes will always work (compared to Virtual includes) as the article states. Please let me know what you think. Thanks.
                      • 8. Re: Question about virtual includes
                        Level 7
                        Here's when you should use virtual includes: when your site architecture
                        places files at varying folder depths and all of those files use the same
                        includes. The use of a virtual include means that no matter where the
                        parent file is located in the site, it can always find the include file,
                        since the path to it always begins with the root of the site.

                        Can you show us the code in the test2.shtml file?

                        > I can make the change into the code, but DW
                        > won?t let me change it in the Properties (this is where I get the error
                        > message
                        > when I try to change the include from File to Virtual).

                        Is this in a template controlled page?

                        The help file you mention says this -

                        a.. If your server is an Apache web server, select Virtual. In Apache,
                        Virtual works in all cases, while File works only in some cases.

                        I'm not sure I agree with that....

                        --
                        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
                        ==================


                        "dale99" <webforumsuser@macromedia.com> wrote in message
                        news:f9j1uo$hho$1@forums.macromedia.com...
                        > Here?s the test page:
                        > http://www.lifeleap.org/test2.shtml
                        >
                        > Here is the include page that goes with this test page:
                        > http://www.lifeleap.org/include1.html
                        >
                        >
                        > The include does seem to be working. As Nancy O mentioned earlier, yes,
                        > this
                        > is what I mean by virtual include. I can make the change into the code,
                        > but DW
                        > won?t let me change it in the Properties (this is where I get the error
                        > message
                        > when I try to change the include from File to Virtual).
                        >
                        > The whole reason I thought I needed to use virtual includes is because I
                        > saw
                        > this help file:
                        >
                        > http://livedocs.adobe.com/dreamweaver/8/using/wwhelp/wwhimpl/common/html/wwhelp.
                        > htm?context=LiveDocs_Parts&file=24_cod15.htm
                        >
                        > It says to use virtual includes if you have an apache server. I have an
                        > apache
                        > server and am wondering if File includes will always work (compared to
                        > Virtual
                        > includes) as the article states. Please let me know what you think.
                        > Thanks.
                        >
                        >


                        • 9. Question about virtual includes
                          dale99 Level 1
                          The fact that I didn't have the DW site created is what was preventing me from being able to create virtual includes. The virtual includes work now but I ran into a new problem. I created a new site with DW and uploaded the files to the new site on our server. Here is the code for the page that is equivalent to test2.shtml (I changed the name for testing purposes).

                          =======================
                          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                          <html xmlns=" http://www.w3.org/1999/xhtml">
                          <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                          <title>Untitled Document</title>
                          </head>

                          <body>
                          <p>page 2<br />
                          <br />
                          include (includes/include1.html):
                          <!--#include virtual="/testfolder/includes/include1.html" -->
                          </p>
                          <p> </p>
                          </body>
                          </html>
                          ===========================

                          The location of this page is : http://www.realreviews.org/rootpage1.shtml

                          Here is the include that is used on rootpage1: http://www.realreviews.org/rootpage1.shtml

                          These pages are in the root directory of my site (or the /httpdocs directory) and they seem to work fine. But when I created new pages, but put them in folders instead of the root, I can’t get the links to work properly now. Here’s the example I set up for testing:

                          I created these two pages:
                          www.realreviews.org/testfolder/folderpage1.shtml
                          www.realreviews.org/testfolder/folderpage2.shtml

                          I inserted this include in both of the above pages (it’s just two hyperlinks that point to the two parent pages):
                          www.realreviews.org/testfolder/includes/include1.html

                          I think I set up the links right in the include page, but when I go to www.realreviews.org/testfolder/folderpage1.shtml and click on the page 2 hyperlink (which is part of the include), it takes me http://www.realreviews.org/folderpage2.shtml, not the correct page http://www.realreviews.org/testfolder/folderpage2.shtml

                          The hyperlinks seem to work fine on pages without includes. I set up two pages (neither have includes) for testing if hyperlinks work on pages nested in folders This page http://www.realreviews.org/testfolder/get1.shtml links just fine to this page http://www.realreviews.org/testfolder/includes/get3.html

                          So I think it has something to do with the way my includes are coded, maybe the way I have my site configured in the site manager - I just can’t figure it out. Any ideas on what I might have done wrong or what I have to do to fix this? Thanks for any help.
                          • 10. Re: Question about virtual includes
                            Level 7


                            > testfolder/includes/include1.html

                            which contains this code:

                            <p><a href="../folderpage1.shtml">page 1</a></p>
                            <p><a href="../folderpage2.shtml">page 2</a></p>

                            Don't use document relative paths INSIDE of included files.
                            Change them to site root relative paths, and they will work anywhere in the
                            site.

                            <p><a href="/testfolder/folderpage1.shtml">page 1</a></p>
                            <p><a href="/testfolder/folderpage2.shtml">page 2</a></p>

                            --
                            Alan
                            Adobe Community Expert, dreamweaver

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



                            • 11. Re: Question about virtual includes
                              Level 7
                              When you upload new pages to server to test, hit F5 or Ctrl+R in your
                              browser to bring up the latest version and not a cached page.

                              Failing that, double check the link properties in your includes html files
                              to be sure they are pointing to the correct link pages.

                              Double check your shtml files to be sure the path to folder/include file is
                              correct.

                              Delete old include html files from your server's root directory. Retest.


                              --Nancy O.
                              Alt-Web Design & Publishing
                              www.alt-web.com




                              "dale99" <webforumsuser@macromedia.com> wrote in message
                              news:f9l9uf$5f4$1@forums.macromedia.com...
                              > The virtual includes work now but I ran into a new problem. I created a
                              new
                              > site with DW and uploaded the files to the new site on our server. Here is
                              the
                              > code for the page that is equivalent to test2.shtml (I changed the name
                              for
                              > testing purposes).
                              >
                              > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                              > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                              > <html xmlns=" http://www.w3.org/1999/xhtml">
                              > <head>
                              > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                              > <title>Untitled Document</title>
                              > </head>
                              >
                              > <body>
                              > <p>page 2<br />
                              > <br />
                              > include (includes/include1.html):
                              > <!--#include virtual="/testfolder/includes/include1.html" -->
                              > </p>
                              > <p> </p>
                              > </body>
                              > </html>
                              >
                              > The location of this page is : http://www.realreviews.org/rootpage1.shtml
                              >
                              > Here is the include that is used on rootpage1:
                              > http://www.realreviews.org/rootpage1.shtml
                              >
                              > These pages are in the root directory of my site (or the /httpdocs
                              directory)
                              > and they seem to work fine. But when I created new pages, but put them in
                              > folders instead of the root, I can?t get the links to work properly now.
                              Here?s
                              > the example I set up for testing:
                              >
                              > I created these two pages:
                              > www.realreviews.org/testfolder/folderpage1.shtml
                              > www.realreviews.org/testfolder/folderpage2.shtml
                              >
                              > I inserted this include in both of the above pages (it?s just two
                              hyperlinks
                              > that point to the two parent pages):
                              > www.realreviews.org/testfolder/includes/include1.html
                              >
                              > I think I set up the links right in the include page, but when I go to
                              > www.realreviews.org/testfolder/folderpage1.shtml and click on the page 2
                              > hyperlink (which is part of the include), it takes me
                              > http://www.realreviews.org/folderpage2.shtml, not the correct page
                              > http://www.realreviews.org/testfolder/folderpage2.shtml
                              >
                              > The hyperlinks seem to work fine on pages without includes. I set up two
                              pages
                              > (neither have includes) for testing if hyperlinks work on pages nested in
                              > folders This page http://www.realreviews.org/testfolder/get1.shtml links
                              just
                              > fine to this page http://www.realreviews.org/testfolder/includes/get3.html
                              >
                              > So I think it has something to do with the way my includes are coded,
                              maybe
                              > the way I have my site configured in the site manager - I just can?t
                              figure it
                              > out. Any ideas on what I might have done wrong or what I have to do to fix
                              > this? Thanks for any help.
                              >
                              >


                              • 12. Question about virtual includes
                                dale99 Level 1
                                Alan,

                                Thanks - it works great now. Is it safe to set the site settings to "Links relative to: Site Root" (instead of "Document") in the site manager so that all hyperlinks will be created like this from this point forward or should I just hand code the includes to correspond with the site root?
                                • 13. Re: Question about virtual includes
                                  Level 7
                                  Either flavor of link works once you upload *except* for links OUT of a
                                  server-side include file. Suit yourself. Be aware that if you use root
                                  relative links, you may find that enabling Preview with temp files to be a
                                  help.

                                  --
                                  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
                                  ==================


                                  "dale99" <webforumsuser@macromedia.com> wrote in message
                                  news:f9ldsa$9cs$1@forums.macromedia.com...
                                  > Alan,
                                  >
                                  > Thanks - it works great now. Is it safe to set the site settings to "Links
                                  > relative to: Site Root" in the site manager so that all hyperlinks will be
                                  > created like this from this point forward or should I just hand code the
                                  > includes to correspond with the site root?
                                  >


                                  • 14. Re: Question about virtual includes
                                    dale99 Level 1
                                    Thanks for the advice. My site is big and I have a lot of pages that use document based links, so maybe I'll just keep it the way it is, and then when I am creating a new include file, I'll turn the root setting on, and then turn it off when I'm done with the include.
                                    • 15. Re: Question about virtual includes
                                      Level 7
                                      No need to do that. You can specify link relativity from the browse panel.

                                      --
                                      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
                                      ==================


                                      "dale99" <webforumsuser@macromedia.com> wrote in message
                                      news:f9ll56$gv2$1@forums.macromedia.com...
                                      > Thanks for the advice. My site is big and I have a lot of pages that use
                                      > document based links, so maybe I'll just keep it the way it is, and then
                                      > when I
                                      > am creating a new include file, I'll turn the root setting on, and then
                                      > turn it
                                      > off when I'm done with the include.
                                      >


                                      • 16. Re: Question about virtual includes
                                        dale99 Level 1
                                        OK, I found it. That makes it a bit more easier. I am having to learn all of this because we are switching over from FrontPage to DW (something I've been putting off for about 4 years). FrontPage extensions are going bye-bye so now we don't have a choice. Let me tell you, DW blows away FP. I'm very impressed.