DWTs how do you deal with BODY tag event handlers?

S

Steve Troxell

Different pages have different handlers for BODY tag events. So I thought of
encasing the BODY tag in an editable region:

DWT:
<!-- #BeginEditable "body-tag" -->
<body>
<!-- #EndEditable -->

But this doesn't work. When ever the DWT is updated, it overwrites anything
in that editable region on pages it is attached to.

So then I thought about adding scripting after the trailing /BODY tag, so
that I can for example perform an "onload" script:

DWT:
</body>
<!-- #BeginEditable "after-body" -->
<!-- #EndEditable -->
</html>

This doesn't work either. If I have local content in the "after-body"
editable region on a page, and I update the template, when it tries to
update that page, it can't find the page's local "after-body" editable
region. I get the dialog that says "Choose Editable Regions for Content".
There is "after-body" in the Old column, and no "after-body" in the New
column. So it doesn't believe there is any local "after-body" content. My
only choice is to skip the page and lose DWT updates or blow away the local
editable region content and reapply it after each DWT update.

So how do you deal with page-specific BODY tag event handlers?
 
S

Stefan B Rusynko

Add an editable region in the HEAD section for custom style sheets and / or scripts or link ref
<!-- #BeginEditable "scripting" -->
<style type="text/css" media="print">.noprint { display: none;} </style>
<link rel="stylesheet" type="text/css" href="some.css">
<script type="text/javascript" language="JavaScript" src="_scripts/popup.js"></script>
<script type="text/javascript" language="JavaScript"><!--
- add a window onload script here
// --> </script>
<!-- #EndEditable -->




| Different pages have different handlers for BODY tag events. So I thought of
| encasing the BODY tag in an editable region:
|
| DWT:
| <!-- #BeginEditable "body-tag" -->
| <body>
| <!-- #EndEditable -->
|
| But this doesn't work. When ever the DWT is updated, it overwrites anything
| in that editable region on pages it is attached to.
|
| So then I thought about adding scripting after the trailing /BODY tag, so
| that I can for example perform an "onload" script:
|
| DWT:
| </body>
| <!-- #BeginEditable "after-body" -->
| <!-- #EndEditable -->
| </html>
|
| This doesn't work either. If I have local content in the "after-body"
| editable region on a page, and I update the template, when it tries to
| update that page, it can't find the page's local "after-body" editable
| region. I get the dialog that says "Choose Editable Regions for Content".
| There is "after-body" in the Old column, and no "after-body" in the New
| column. So it doesn't believe there is any local "after-body" content. My
| only choice is to skip the page and lose DWT updates or blow away the local
| editable region content and reapply it after each DWT update.
|
| So how do you deal with page-specific BODY tag event handlers?
|
| --
| Steve Troxell
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top