6 Replies Latest reply on Jul 10, 2008 4:44 AM by Newsgroup_User

    <body> tag in include?

    Level 7
      Hi Guys,

      Is it okay to have the opening <body> tag in a PHP include? I'd like to be
      able to add and revise some global onLoad events.

      Thanks.
      Phil


        • 1. Re: &lt;body&gt; tag in include?
          Level 7
          .oO(Phil Papeman)

          >Is it okay to have the opening <body> tag in a PHP include? I'd like to be
          >able to add and revise some global onLoad events.

          Sure. Just make sure in the final HTML page there's only _one_ 'body'
          element. Where it comes from doesn't matter.

          Micha
          • 2. Re: &lt;body&gt; tag in include?
            JoeDaSilva Level 4
            A php include just says "put the following code here". You could have a single tag as an include, or the entire website as an include if you wanted.
            • 3. Re: &lt;body&gt; tag in include?
              bregent Most Valuable Participant
              >Sure. Just make sure in the final HTML page there's only _one_ 'body'
              >element. Where it comes from doesn't matter.

              While this is correct from an html standpoint, I've heard that DW has problems when the body tags are in includes - at least it did in earlier versions. I don't recall the specifics but I've seen Murray mention it. Do you know if CS3 handles this better?
              • 4. Re: &lt;body&gt; tag in include?
                Level 7
                On Wed, 9 Jul 2008 17:31:44 -0700, "Phil Papeman"
                <plpapeman@remove_comcast.net> wrote:

                >Hi Guys,
                >
                >Is it okay to have the opening <body> tag in a PHP include? I'd like to be
                >able to add and revise some global onLoad events.
                >
                >Thanks.
                >Phil
                >

                I suspect there will be problems with that approach.

                But if you want the option of adding code to the body tag in some /
                all pages individually look this up in the help system

                "Specify editable tag attributes in a template "


                --

                ~Malcolm~*...
                ~*
                • 5. Re: &lt;body&gt; tag in include?
                  Level 7
                  > Is it okay to have the opening <body> tag in a PHP include?

                  Yes, in terms of the performance of the webpage on the server. Makes no
                  difference how the page is pieced together via Includes provided the page
                  structure (head, body etc) is valid once it's delivered by the server to the
                  browser.

                  See this 2004 article about DWfaq.com (hasn't been updated for over 12
                  months but you get the point) where Daniel Short describes doing exactly
                  this.
                  http://webddj.sys-con.com/read/46268.htm

                  The only issue would be if you need to apply behaviors to the <body> tag in
                  DW.

                  --
                  Regards

                  John Waller

                  • 6. Re: &lt;body&gt; tag in include?
                    Level 7
                    DW has had problems if the <html>, <head>, or <body> tags are in an include
                    file. I just tested in CS4, and that seemed to work OK. I believe Brenda
                    posted on the webbiz forum recently that she had also done this
                    successfully.

                    Give it a try....

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


                    "bregent" <webforumsuser@macromedia.com> wrote in message
                    news:g53og7$jil$1@forums.macromedia.com...
                    > >Sure. Just make sure in the final HTML page there's only _one_ 'body'
                    > >element. Where it comes from doesn't matter.
                    >
                    > While this is correct from an html standpoint, I've heard that DW has
                    > problems
                    > when the body tags are in includes - at least it did in earlier versions.
                    > I
                    > don't recall the specifics but I've seen Murray mention it. Do you know if
                    > CS3
                    > handles this better?
                    >
                    >