HighDots Forums  

Re: Body-on load in template question

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Re: Body-on load in template question in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Body-on load in template question - 07-07-2003 , 08:46 PM






Charles:

OK - here are your options....

1. As you suggested, detach that page from the template and simply add the
required behaviors to the body tag. This is simple and easy to do, and it
will work, but it violates the whole feng shui of the use of templates,
doncha know?

2. Apply the required behaviors to the template page. Move the javascript
to support those calls into the editable region of the head of the template
document and *all* child pages. Then in the template, and in all child
pages *except* the one where you want to actually Snap, etc., replace each
function's definition with "return true;". Now, each child page will call
the routines which will just return true for all pages, except the one where
you need the routines to do something. On that page, the required
javascript is still actually in the head and it performs the needed action.
This is the next in order of simplicity.

3. Apply the required behaviors to a dummy page. Add the javascript from
the head of that document to an external javascript file to which all of the
pages are linked by virtue of a link in the head (non-editable) region of
the Template page. Make the onLoad attribute of the Template's body tag
into an editable attribute (MODIFY | Templates > Make Attribute
Editable...). Make the default value of the attribute be null. Save the
Template and allow this change to propagate to the child pages. In the
child page where the behavior is required, copy the onLoad call from the
dummy page and set the editable attribute's parameter to the value of the
onLoad call (i.e., copy the call to the clipboard, and paste it in when you
open the child page, and use MODIFY | Template Properties). I believe that
this is the more complex alternative.

Each of these methods will work. For obvious reasons, I prefer the latter
two.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Charles Newbury" <newburcj (AT) epix (DOT) net> wrote

Quote:
On 7/7/03 5:17 PM, in article beco23$ohu$1 (AT) forums (DOT) macromedia.com, "Murray
*TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote:

Charles:

The best way to bring a non-templated page under control of a template
is to
spawn a new page from the template, and copy and paste from the existing
page into the new child page before then overwriting the existing page
with
the new child page.

What are the onLoad events/behaviors you want to fine tune? And do you
want
to make them occur in all pages or only certain pages?

The onload in the body tag include: PVII Layout Designer2-Screen, PVII
Layout Designer2-Layer (for aligning the layers in the page) and
Autolayers
by PVII to set the visibility for later show/hides called by clicking
links
within the page. These onload behaviors only need to be associated with
this
particular page and aren't needed in the navigation template.

If this is not easily doable, I suppose I could copy/paste the navigation
layers from the template to this page and simply not associate it with the
template.




Reply With Quote
  #2  
Old   
Charles Newbury
 
Posts: n/a

Default Re: Body-on load in template question - 07-07-2003 , 11:24 PM






On 7/7/03 8:46 PM, in article bed4aq$c9m$1 (AT) forums (DOT) macromedia.com, "Murray
*TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote:

Quote:
Charles:

OK - here are your options....

snip

Quote:
Each of these methods will work. For obvious reasons, I prefer the latter
two.
Thank you! Will give these techniques some thought and try one or both.

Joe Newbury



Reply With Quote
  #3  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Body-on load in template question - 07-08-2003 , 07:22 AM



Joe:

You're welcome. Do let me know how you get on!

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Charles Newbury" <newburcj (AT) epix (DOT) net> wrote

Quote:
On 7/7/03 8:46 PM, in article bed4aq$c9m$1 (AT) forums (DOT) macromedia.com, "Murray
*TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote:

Charles:

OK - here are your options....

snip

Each of these methods will work. For obvious reasons, I prefer the
latter
two.

Thank you! Will give these techniques some thought and try one or both.

Joe Newbury




Reply With Quote
  #4  
Old   
Charles Newbury
 
Posts: n/a

Default Re: Body-on load in template question - 07-08-2003 , 10:59 AM



On 7/8/03 7:22 AM, in article bee9ji$6na$1 (AT) forums (DOT) macromedia.com, "Murray
*TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote:

Quote:
Joe:

You're welcome. Do let me know how you get on!
Ran into a bit of a puzzle. The template itself has onload body tag
behaviors: Preloading some rollover graphics and Geewhiz Scroller
initialization. If I make the body onload editable in the template with
these behaviors default, how do I add the additional calls? Separate the
final default behavior with a semicolon and paste the layer initialization
calls? Coding javascript is way outside my comfort zone and although I like
using css positioning and autolayer effects, which worked fine in individual
pages in the frameset, 'deframing' via template is very complicated for the
javascript challenged. In fact, any child page creation via template will be
difficult should you desire to use these behaviors on certain child pages
but not all, or use them but in a different fashion.

This may be an opportunity for the extension developers. People who create
pages from templates will invariably find the need to add layers to their
child's editable regions that they will want to position, and initialize;
autolayer and css positioning behaviors come to mind. The need, as I see it,
is to be able to modify/change the templates onload default, e.g., add
behaviors to the template's default for specific child pages. An extension
to facilitate this process or an 'idiot proof', step-by-step tutorial
outlining your preciously mentioned methods would be very helpful.

Templates do appear to be the way to go to eliminate frames but they are not
always intuitively obvious in their application or flexibility.

Again, thanks for your help.

Charles Newbury



Reply With Quote
  #5  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Body-on load in template question - 07-08-2003 , 11:23 AM



Charles:

Well, this complicates things a bit, but is not a showstopper by any means.

So - you have some onLoad calls that you want to leave on all pages, and a
few that you want to add to only one page - is that correct?

Please paste the body tag code of your template as it sits now into a reply,
and I'll show you how to change it.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Charles Newbury" <newburcj (AT) epix (DOT) net> wrote

Quote:
Ran into a bit of a puzzle. The template itself has onload body tag
behaviors: Preloading some rollover graphics and Geewhiz Scroller
initialization. If I make the body onload editable in the template with
these behaviors default, how do I add the additional calls? Separate the
final default behavior with a semicolon and paste the layer initialization
calls? Coding javascript is way outside my comfort zone and although I
like
using css positioning and autolayer effects, which worked fine in
individual
pages in the frameset, 'deframing' via template is very complicated for
the
javascript challenged. In fact, any child page creation via template will
be
difficult should you desire to use these behaviors on certain child pages
but not all, or use them but in a different fashion.





Reply With Quote
  #6  
Old   
Charles Newbury
 
Posts: n/a

Default Re: Body-on load in template question - 07-08-2003 , 01:07 PM



On 7/8/03 11:23 AM, in article beenlt$6eg$1 (AT) forums (DOT) macromedia.com, "Murray
*TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote:

Quote:
Charles:

Well, this complicates things a bit, but is not a showstopper by any means.

So - you have some onLoad calls that you want to leave on all pages, and a
few that you want to add to only one page - is that correct?
That is correct. The template navigation along the top (Fireworks popup) is
site navigation. The Geewhizz Scrollar along the left lets you select shows
from previous productions. Some of the previous show pages are simply html,
others are Flash movies, still others contain links which show/hide layers
within the page showing cast, crew, scenes and links to photos.
Quote:
Please paste the body tag code of your template as it sits now into a reply,
and I'll show you how to change it.
Okay...it's rather verbose, especially after I tried to make the body onload
property editable last night...

<body bgcolor="#ffffff" onLoad="@@(onload)@@">

<div id="prodcontent" style="position:absolute; left:205px; top:129px;
width:555px; height:224px; z-index:104; overflow: visible;">

<!-- TemplateBeginEditable name="ProdContent" --><!-- TemplateEndEditable
--></div>
<a name="top"></a>

<script language="JavaScript1.2">mmLoadMenus();</script>
<table border="0" cellpadding="0" cellspacing="0" width="750">
<!-- fwtable fwsrc="navz.png" fwbase="navz.gif" fwstyle="Dreamweaver"
fwdocid = "742308039" fwnested="0" -->
<tr>

SNIP - buch of spacer gifs

</tr>
<tr>
<td colspan="13"><img name="navz_r1_c1" src="../navz_r1_c1.gif"
width="750" height="14" border="0" alt=""></td>
<td><img src="../spacer.gif" width="1" height="14" border="0"
alt=""></td>
</tr>
<tr>
<td rowspan="3"><img name="navz_r2_c1" src="../navz_r2_c1.gif"
width="137" height="66" border="0" alt="Winding River Players"></td>
<td><a href="../home.html" target="_top"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('navz_r2_c2','','../navz_r2_c2_f2.gif',1)"><img
name="navz_r2_c2" src="../navz_r2_c2.gif" width="31" height="8" border="0"
alt="Home"></a></td>
<td rowspan="3"><img name="navz_r2_c3" src="../navz_r2_c3.gif"
width="46" height="66" border="0" alt=""></td>
<td><a href="../tickets.html" target="_top"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('navz_r2_c4','','../navz_r2_c4_f2.gif',1)"><img
name="navz_r2_c4" src="../navz_r2_c4.gif" width="40" height="8" border="0"
alt="Tickets"></a></td>
<td rowspan="3"><img name="navz_r2_c5" src="../navz_r2_c5.gif"
width="47" height="66" border="0" alt=""></td>
<td rowspan="2"><a href="javascript:;" onMouseOut="MM_startTimeout();"
onMouseOver="MM_showMenu(window.mm_menu_0705082551 _0,-30,20,null,'navz_r2_c6
');"><img name="navz_r2_c6" src="../navz_r2_c6.gif" width="52" height="10"
border="0" alt="The Company"></a></td>
<td rowspan="3"><img name="navz_r2_c7" src="../navz_r2_c7.gif"
width="47" height="66" border="0" alt=""></td>
<td><a href="../Prod_Past_ndx.html" target="_top"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('navz_r2_c8','','../navz_r2_c8_f2.gif',1)"><img
name="navz_r2_c8" src="../navz_r2_c8.gif" width="35" height="8" border="0"
alt="Album"></a></td>
<td rowspan="3"><img name="navz_r2_c9" src="../navz_r2_c9.gif"
width="47" height="66" border="0" alt=""></td>
<td><a href="../news.html" target="_top"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('navz_r2_c10','','../navz_r2_c10_f2.gif',1)"><img
name="navz_r2_c10" src="../navz_r2_c10.gif" width="30" height="8" border="0"
alt="WRP News"></a></td>
<td rowspan="3"><img name="navz_r2_c11" src="../navz_r2_c11.gif"
width="47" height="66" border="0" alt=""></td>
<td><a href="javascript:;" onMouseOut="MM_startTimeout();"
onMouseOver="MM_showMenu(window.mm_menu_0705083433 _1,-80,20,null,'navz_r2_c1
2');"><img name="navz_r2_c12" src="../navz_r2_c12.gif" width="63" height="8"
border="0" alt="About WRP"></a></td>
<td rowspan="3"><img name="navz_r2_c13" src="../navz_r2_c13.gif"
width="128" height="66" border="0" alt=""></td>
<td><img src="../spacer.gif" width="1" height="8" border="0"
alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="navz_r3_c2" src="../navz_r3_c2.gif"
width="31" height="58" border="0" alt=""></td>
<td rowspan="2"><img name="navz_r3_c4" src="../navz_r3_c4.gif"
width="40" height="58" border="0" alt=""></td>
<td rowspan="2"><img name="navz_r3_c8" src="../navz_r3_c8.gif"
width="35" height="58" border="0" alt=""></td>
<td rowspan="2"><img name="navz_r3_c10" src="../navz_r3_c10.gif"
width="30" height="58" border="0" alt=""></td>
<td rowspan="2"><img name="navz_r3_c12" src="../navz_r3_c12.gif"
width="63" height="58" border="0" alt=""></td>
<td><img src="../spacer.gif" width="1" height="2" border="0"
alt=""></td>
</tr>
<tr>
<td><img name="navz_r4_c6" src="../navz_r4_c6.gif" width="52"
height="56" border="0" alt=""></td>
<td><img src="../spacer.gif" width="1" height="56" border="0"
alt=""></td>
</tr>
</table>
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img name="wrprodmenu" src="../graphics/wrprodmenu.gif" width="168"
height="32" border="0" alt="WRP Production Menu"><p></p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<!-- TemplateBeginEditable name="Xtralayers" -->Xtralayers<!--
TemplateEndEditable -->
<div id="p7sc1BG" style="position:absolute; left:10px; top:125px;
width:170px; height:300px; z-index:99; background-color: #660000;
layer-background-color: #660000; border: 1px none #000000;"></div>
<div id="p7scroller1" style="position:absolute; width:168px; height:288px;
z-index:100; left: 11px; top: 126px; overflow: hidden; clip: rect(0px 168px
288px 0px); visibility: visible; background-color: #FFFF99;
layer-background-color: #FFFF99; border: 1px none #000000">
<div id="p7s1content1">
<table width="168" border="0" cellspacing="6" cellpadding="0">
<tr>
<td class="pviiscroller"><table width="160" border="0"
cellspacing="0" cellpadding="0">
<tr>
SNIP - Large Geewhizz table

</table> <p>&nbsp;</p>
</td>
</tr>
</table>
</div>
</div>
<div id="p7sc1ResetBG" style="position:absolute; left:180px; top:306px;
width:18px; height:20px; z-index:102; background-color: #660000;
layer-background-color: #660000"><img src="../gwimages/shim.gif" width="18"
height="20"></div>
<div id="p7sc1Reset" style="position:absolute; left:179px; top:307px;
width:18px; height:18px; z-index:103; background-color: #FFFF99;
layer-background-color: #FFFF99"><a href="javascript:;"
onMouseDown="P7_runScroller('p7scroller1','Reset', 'Medium',0,0,0,0);return
false" onClick="return false" onFocus="if(this.blur)this.blur()"><img
src="../gwimages/p7gw_reset.gif" width="18" height="18" border="0"
alt="Reset"></a></div>
<div id="p7sc1UpBG" style="position:absolute; left:180px; top:348px;
width:18px; height:20px; z-index:102; background-color: #660000;
layer-background-color: #660000"><img src="../gwimages/shim.gif" width="18"
height="20"></div>
<div id="p7sc1Up" style="position:absolute; left:179px; top:349px;
width:18px; height:18px; z-index:103; background-color: #FFFF99;
layer-background-color: #FFFF99"><a href="javascript:;"
onMouseDown="P7_runScroller('p7scroller1','Up','Me dium',0,0,0,0);return
false" onMouseUp="P7_runScroller('p7scroller1','Stop','Me dium',0,0,0,0)"
onClick="return false" onFocus="if(this.blur)this.blur()"><img
src="../gwimages/p7gw_up.gif" width="18" height="18" border="0"
alt="Up"></a></div>
<div id="p7sc1DownBG" style="position:absolute; left:180px; top:378px;
width:18px; height:20px; z-index:102; background-color: #660000;
layer-background-color: #660000"><img src="../gwimages/shim.gif" width="18"
height="20"></div>
<div id="p7sc1Down" style="position:absolute; left:179px; top:379px;
width:18px; height:18px; z-index:103; background-color: #FFFF99;
layer-background-color: #FFFF99"><a href="javascript:;"
onMouseDown="P7_runScroller('p7scroller1','Down',' Medium',0,0,0,0);return
false" onMouseUp="P7_runScroller('p7scroller1','Stop','Me dium',0,0,0,0)"
onClick="return false" onFocus="if(this.blur)this.blur()"><img
src="../gwimages/p7gw_down.gif" width="18" height="18" border="0"
alt="Down"></a></div>



Reply With Quote
  #7  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Body-on load in template question - 07-08-2003 , 01:09 PM



Charles:

I can see that I didn't speak distinctly enough! 8)

Please show me the code for *only* the body tag, on pages that have not yet
had your editable attribute attempt applied to it! (and by the way, I hope
your page doesn't just end like what you pasted in???

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Charles Newbury" <newburcj (AT) epix (DOT) net> wrote

Quote:
Okay...it's rather verbose, especially after I tried to make the body
onload
property editable last night...

body bgcolor="#ffffff" onLoad="@@(onload)@@"





Reply With Quote
  #8  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Body-on load in template question - 07-09-2003 , 07:07 AM



Charles:

I am assuming that you want to leave the Snap and the autolayers call in the
body tag for all pages.

Change this (in the Template page) -

<body
onLoad="P7_Snap('earthlings','amaterra',280,0,'ear thlings','cast',280,0,'ear
thlings','crew',280,0,'earthlings','poster',280,0, 'earthlings','thanks',280,
0);P7_autoLayers(0,'poster')">


to this -

<body
onLoad="P7_Snap('earthlings','amaterra',280,0,'ear thlings','cast',280,0,'ear
thlings','crew',280,0,'earthlings','poster',280,0, 'earthlings','thanks',280,
0);P7_autoLayers(0,'poster');@@(bodyOnLoad)@@;">

and include this in the head of the Template -

<!-- TemplateParam name="bodyOnLoad" type="text" value="" -->

Then in a child page where you want to have the additional onLoad calls, use
MODIFY | Template Properties, and copy and paste the additional calls from a
detached page into the dialog panel for this option, e.g.,

P7_Snap('earthlings','amaterra',280,0,'earthlings' ,'cast',280,0,'ear
thlings','crew',280,0,'earthlings','poster',280,0, 'earthlings','thanks',280,
0)

(I know that I have repeated the P7_Snap call - this is just for
illustration)

and that should work fine.


--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Charles Newbury" <newburcj (AT) epix (DOT) net> wrote

Quote:
On 7/8/03 1:09 PM, in article beetu6$im0$1 (AT) forums (DOT) macromedia.com, "Murray
*TMM*" <forums (AT) HAHAgreat-web-sights (DOT) com> wrote:

I can see that I didn't speak distinctly enough! 8)

Please show me the code for *only* the body tag, on pages that have not
yet
had your editable attribute attempt applied to it! (and by the way, I
hope
your page doesn't just end like what you pasted in???

--
Murray --- ICQ 71997575

No :-)...lots of snips for brevity. But here's one from a page that I have
not tried to attach the template to:

body

onLoad="P7_Snap('earthlings','amaterra',280,0,'ear thlings','cast',280,0,'ear

thlings','crew',280,0,'earthlings','poster',280,0, 'earthlings','thanks',280,
0);P7_autoLayers(0,'poster')"

Thanks!




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.