4 Replies Latest reply: Mar 16, 2009 2:28 PM by Newsgroup_User RSS

    Dynamic Content from Database and DW Templates

    andrewmcgibbon Community Member
      I am reskinning a site and they have a couple of pages that draw on content pulled from a database. I am trying to use templates for the site to make updates easier. The problem is, in a situation where you are using templates, for those pages requiring the database connection and the query, you have code at the very top of the document (the database connection and query). I get an error when trying to generate a page from the template and include this code. It says it is outside of the editable region and won't be saved the next time I make changes to the template and update it.

      Does any have any suggestions on creating a page from a template that incorporates database data?

      Many thanks in advance for your suggestions.

      Regards,
      Andy
        • 1. Re: Dynamic Content from Database and DW Templates
          Newsgroup_User Community Member
          > I get an
          > error when trying to generate a page from the template and include this
          > code.
          > It says it is outside of the editable region and won't be saved the next
          > time I
          > make changes to the template and update it.

          Let's see the page, please. Can you post a link to it?

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

          • 2. Re: Dynamic Content from Database and DW Templates
            andrewmcgibbon Community Member
            This is the page that utilizes a template. For some reason or another, it seems to allow us to keep the code before the HTML for the query and the database connection. I can't get other pages to be ok with this. I have an entire section of .aps pages that pull from a database and would like to have a single template rather than having to update all the pages manually.

            Thanks again for your help.

            http://www.jalc.org/concerts/index09B.asp
            • 3. Re: Dynamic Content from Database and DW Templates
              andrewmcgibbon Community Member
              To better explain this, I am trying to define a dynamic template that will allow me to add server behaviors.
              • 4. Re: Dynamic Content from Database and DW Templates
                Newsgroup_User Community Member
                See this line -

                <!-- InstanceBegin template="/Templates/concerts09.dwt"
                codeOutsideHTMLIsLocked="false" -->

                Code outside HTML is locked=false means that DW will treat the region ABOVE
                <html> and below </html> as an editable region. This means you can open a
                child page and add recordsets, or any scripting you want in either of those
                locations with absolute abandon. What will *not* happen is if you open the
                Template file and add something there in those same regions, existing child
                pages will not receive those changes (however NEW child pages will be
                created already containing them, although as with any editable region
                changes in a Template file, changes to that code in the Template will not
                then propagate to existing child pages).

                Does that help you understand what is going on?

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


                "andrewmcgibbon" <webforumsuser@macromedia.com> wrote in message
                news:gpm345$6u3$1@forums.macromedia.com...
                > This is the page that utilizes a template. For some reason or another, it
                > seems to allow us to keep the code before the HTML for the query and the
                > database connection. I can't get other pages to be ok with this. I have
                > an
                > entire section of .aps pages that pull from a database and would like to
                > have a
                > single template rather than having to update all the pages manually.
                >
                > Thanks again for your help.
                >
                > http://www.jalc.org/concerts/index09B.asp
                >
                >