6 Replies Latest reply on Aug 6, 2007 12:43 PM by DavidKerr

    DW onload tags overwritten by Template

    DavidKerr
      So I've read the posts and the help about editable tag attributes. I think I get what I should do, but DW is still overwriting my "editable" attributes so I hope I'm just missing something... Any suggestions? Thanks!

      DETAILS:

      In my template, I've selected the body tag (in the code window), chosen "Modify > Templates > Make Attribute Editable" and set the onload attribute to be editable. The template has this code for the body tag: "<body onload="@@(onload)@@">" which seems promising.

      I go to the page based on the template (web.html), apply the swap image behavior, and DW writes the onload="MM_preloadImages code for the images to be swapped (the template started out with one preload image, DW adds 2).

      If I update the template while this page is OPEN, no problem, the preload stays. But if I close web.html and update the template, web.html now has only the "default" original onload info, and the code is lost.

      Any ideas?

      Here are the files:

      Document template is applied to:
      http://www.davidkerrdesign.com/new/web.html

      The template is here (although I can't get either Firefox or IE to display it--maybe browsers can't display .dwt files on the web?):
      http://www.davidkerrdesign.com/Templates/dkdinside.dwt

      Just in case here's the template header through the body code:

      <!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" />
      <!-- TemplateBeginEditable name="dochead" -->
      <title>David Kerr Design</title>
      <!-- TemplateEndEditable --><!-- TemplateBeginEditable name="headscript" --><!-- TemplateEndEditable -->
      <style type="text/css">
      <!--
      -->
      </style>
      <link href="../new/css/dkd-css.css" rel="stylesheet" type="text/css" />
      <link href="favicon.ico" rel="shortcut icon" />
      <script src="../new/css/mm.js" language="JavaScript" type="text/javascript"></script>
      <!-- TemplateParam name="onload" type="text" value="MM_preloadImages('../images-new/dkd-logo-over.gif')" -->
      </head>
      <body onload="@@(onload)@@">

      Thanks!
      David
        • 1. Re: DW onload tags overwritten by Template
          Level 7
          What are you wanting to do with this editable attribute?

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


          "DavidKerr" <webforumsuser@macromedia.com> wrote in message
          news:f938l5$ilf$1@forums.macromedia.com...
          > So I've read the posts and the help about editable tag attributes. I think
          > I
          > get what I should do, but DW is still overwriting my "editable" attributes
          > so I
          > hope I'm just missing something... Any suggestions? Thanks!
          >
          > DETAILS:
          >
          > In my template, I've selected the body tag (in the code window), chosen
          > "Modify > Templates > Make Attribute Editable" and set the onload
          > attribute to
          > be editable. The template has this code for the body tag: "<body
          > onload="@@(onload)@@">" which seems promising.
          >
          > I go to the page based on the template (web.html), apply the swap image
          > behavior, and DW writes the onload="MM_preloadImages code for the images
          > to
          > be swapped (the template started out with one preload image, DW adds 2).
          >
          > If I update the template while this page is OPEN, no problem, the preload
          > stays. But if I close web.html and update the template, web.html now has
          > only
          > the "default" original onload info, and the code is lost.
          >
          > Any ideas?
          >
          > Here are the files:
          >
          > Document template is applied to:
          > http://www.davidkerrdesign.com/new/web.html
          >
          > The template is here (although I can't get either Firefox or IE to display
          > it--maybe browsers can't display .dwt files on the web?):
          > http://www.davidkerrdesign.com/Templates/dkdinside.dwt
          >
          > Just in case here's the template header through the body code:
          >
          > <!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" />
          > <!-- TemplateBeginEditable name="dochead" -->
          > <title>David Kerr Design</title>
          > <!-- TemplateEndEditable --><!-- TemplateBeginEditable name="headscript"
          > --><!-- TemplateEndEditable -->
          > <style type="text/css">
          > <!--
          > -->
          > </style>
          > <link href="../new/css/dkd-css.css" rel="stylesheet" type="text/css" />
          > <link href="favicon.ico" rel="shortcut icon" />
          > <script src="../new/css/mm.js" language="JavaScript"
          > type="text/javascript"></script>
          > <!-- TemplateParam name="onload" type="text"
          > value="MM_preloadImages('../images-new/dkd-logo-over.gif')" -->
          > </head>
          > <body onload="@@(onload)@@">
          >
          > Thanks!
          > David
          >

          • 2. Re: DW onload tags overwritten by Template
            DavidKerr Level 1
            I want to recreate the remote rollovers on the page (see my live site for the working version done in GL--just remove the /new from the url).

            The behaviors are working fine, but if the template strips the preload code out whenever there are changes I think I don't have something set up correctly.

            Is there another way to do the swapimage preload?
            • 3. Re: DW onload tags overwritten by Template
              Level 7
              Just make sure that the template file itself is preloading those images.

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


              "DavidKerr" <webforumsuser@macromedia.com> wrote in message
              news:f95ctj$21n$1@forums.macromedia.com...
              >I want to recreate the remote rollovers on the page (see my live site for
              >the
              > working version done in GL--just remove the /new from the url).
              >
              > The behaviors are working fine, but if the template strips the preload
              > code
              > out whenever there are changes I think I don't have something set up
              > correctly.
              >
              > Is there another way to do the swapimage preload?
              >


              • 4. Re: DW onload tags overwritten by Template
                DavidKerr Level 1
                But I need to preload different images on 5 or 6 different pages. Just the one page needs the 20 or 30 preloaders.

                I have to preload them all on all pages? Doesn't make sense.
                • 5. Re: DW onload tags overwritten by Template
                  Level 7
                  Why not? Once they are loaded, they are cached, anyhow, and never fetched
                  from the server again. What is the combined weight of all of these images?

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


                  "DavidKerr" <webforumsuser@macromedia.com> wrote in message
                  news:f95ick$7le$1@forums.macromedia.com...
                  > But I need to preload different images on 5 or 6 different pages. Just the
                  > one page needs the 20 or 30 preloaders.
                  >
                  > I have to preload them all on all pages? Doesn't make sense.


                  • 6. Re: DW onload tags overwritten by Template
                    DavidKerr Level 1
                    Good point. Just seems like a funny workaround. Thanks for the suggestion!

                    (Also, I think I figured out what's happening--to make use of the editable attribute you have to use the pulldown menus, so when DW is adding data to the onload, it's not coding it to take advantage of the editable attribute--if you use the menus, these overrides do stay in the template).

                    Thanks!