This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > September 2005 > DW Template, optional BODY onLoad not working





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author DW Template, optional BODY onLoad not working
Wallace Wilcox

2005-09-30, 6:21 pm

I need to make an BODY onLoad statement optional in a Dreamweaver template. I
have created a parameter:

<!-- TemplateParam name="LoadTIConnect" type="boolean" value="false" -->

But when I try to use it Dreamweaver complains of errors and won't update any
pages. I have tried two different methods. First a simple if statement:

<BODY <!-- TemplateBeginIf cond="LoadTIConnect"-->onLoad="loadPageTIC();"<!--
TemplateEndIf -->>

When updating pages from a template with this line in it, Dreamweaver
complains of an unbalanced </BODY> tag, meaning the tag above isn't being
recognized by DW as a <BODY> tag. I have also tried a multiple if statement:

<!-- TemplateBeginMultipleIf -->
<!-- TemplateBeginIfClause cond="LoadTIConnect==true" -->
<BODY onLoad="loadPageTIC();">
<!-- TemplateEndIfClause -->
<!-- TemplateBeginIfClause cond="LoadTIConnect=false" -->
<BODY>
<!-- TemplateEndIfClause -->
<!-- TemplateEndMultipleIf -->

But for some reason DW complains of nested editable regions on this one. Is
there a way to achieve my desired result within the DW MX2004 template system?

Stephanie Sullivan

2005-09-30, 6:21 pm

On 9/30/05 11:42 AM, in article dhjmdf$nat$1@forums.macromedia.com, "Wallace
Wilcox" <webforumsuser@macromedia.com> wrote:

> But for some reason DW complains of nested editable regions on this one. Is
> there a way to achieve my desired result within the DW MX2004 template system?


Perhaps it's the way you're creating it... What I do is to highlight the
opening body tag -- then go to Modify > Templates > Make Attribute Editable
(then it will allow you to set the editable parameters in there)...

On the child pages, you'll simply go to Modify > Template Properties... And
change the onLoad values...

Stephanie Sullivan
Community MX Partner :: http://www.communitymx.com/author.cfm?cid=1008
Team Macromedia for Dreamweaver :: http://tinyurl.com/6huw3
Co-Author .: "Macromedia Dreamweaver MX 2004 Magic" :. New Riders
VioletSky Design :: http://www.violetsky.net

"Watch what people are cynical about and one can discover what they lack."
-Harry Emerson Fosdick


Murray *TMM*

2005-09-30, 6:21 pm

This markup will never work, Wallace.

Remove all this from your page. Then select the body tag, and go through the
MODIFY | Templates > Make Attribute Editable, menu choice to add the onLoad
attribute as the target of the parameter. Specify that the parameter's
value be null as a default.

This will then create the following markup on your page -

<!-- TemplateParam name="LoadTIConnect" type="text" value="" -->
</head>
<body onLoad="@@(LoadTIConnect)@@">

which by default will evaluate to this -

<body onLoad="">

When you give the parameter a value on a child page, using MODIFY | Template
Properties, it will then appear in that onLoad attribute's value.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(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
==================

"Wallace Wilcox" <webforumsuser@macromedia.com> wrote in message
news:dhjmdf$nat$1@forums.macromedia.com...
>I need to make an BODY onLoad statement optional in a Dreamweaver template.
>I
> have created a parameter:
>
> <!-- TemplateParam name="LoadTIConnect" type="boolean" value="false" -->
>
> But when I try to use it Dreamweaver complains of errors and won't update
> any
> pages. I have tried two different methods. First a simple if statement:
>
> <BODY <!-- TemplateBeginIf
> cond="LoadTIConnect"-->onLoad="loadPageTIC();"<!--
> TemplateEndIf -->>
>
> When updating pages from a template with this line in it, Dreamweaver
> complains of an unbalanced </BODY> tag, meaning the tag above isn't being
> recognized by DW as a <BODY> tag. I have also tried a multiple if
> statement:
>
> <!-- TemplateBeginMultipleIf -->
> <!-- TemplateBeginIfClause cond="LoadTIConnect==true" -->
> <BODY onLoad="loadPageTIC();">
> <!-- TemplateEndIfClause -->
> <!-- TemplateBeginIfClause cond="LoadTIConnect=false" -->
> <BODY>
> <!-- TemplateEndIfClause -->
> <!-- TemplateEndMultipleIf -->
>
> But for some reason DW complains of nested editable regions on this one.
> Is
> there a way to achieve my desired result within the DW MX2004 template
> system?
>



Stephanie Sullivan

2005-09-30, 6:21 pm

On 9/30/05 12:11 PM, in article dhjo3r$pp2$1@forums.macromedia.com, "Murray
*TMM*" <forums@HAHAgreat-web-sights.com> wrote:

> Remove all this from your page. Then select the body tag, and go through

the...

Wow, Murray! 13 minutes. ;)

Stephanie Sullivan
Community MX Partner :: http://www.communitymx.com/author.cfm?cid=1008
Team Macromedia for Dreamweaver :: http://tinyurl.com/6huw3
Co-Author .: "Macromedia Dreamweaver MX 2004 Magic" :. New Riders
VioletSky Design :: http://www.violetsky.net

The man who goes farthest is generally the one who is willing to do and
dare. The sure thing boat never gets far from shore. -- Dale Carnegie


Murray *TMM*

2005-09-30, 6:21 pm

I let your answer sit for a while in plain view first.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(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
==================

"Stephanie Sullivan" <stephanie@communitymx.com> wrote in message
news:BF62DD31.566F6%stephanie@communitymx.com...
> On 9/30/05 12:11 PM, in article dhjo3r$pp2$1@forums.macromedia.com,
> "Murray
> *TMM*" <forums@HAHAgreat-web-sights.com> wrote:
>
> the...
>
> Wow, Murray! 13 minutes. ;)
>
> Stephanie Sullivan
> Community MX Partner :: http://www.communitymx.com/author.cfm?cid=1008
> Team Macromedia for Dreamweaver :: http://tinyurl.com/6huw3
> Co-Author .: "Macromedia Dreamweaver MX 2004 Magic" :. New Riders
> VioletSky Design :: http://www.violetsky.net
>
> The man who goes farthest is generally the one who is willing to do and
> dare. The sure thing boat never gets far from shore. -- Dale Carnegie
>
>



Stephanie Sullivan

2005-09-30, 6:21 pm

On 9/30/05 12:18 PM, in article dhjoh4$qco$1@forums.macromedia.com, "Murray
*TMM*" <forums@HAHAgreat-web-sights.com> wrote:

> I let your answer sit for a while in plain view first.


Yea, yea, yea... Sore loser. :P

Stephanie Sullivan
Community MX Partner :: http://www.communitymx.com/author.cfm?cid=1008
Team Macromedia for Dreamweaver :: http://tinyurl.com/6huw3
Co-Author .: "Macromedia Dreamweaver MX 2004 Magic" :. New Riders
VioletSky Design :: http://www.violetsky.net

"Hide not your talents. They for use were made. What's a sundial in the
shade." -- Benjamin Franklin


Wallace Wilcox

2005-09-30, 6:21 pm

Unfortunately, this means that our Contribute users would have to manually type
in "loadPageTIC();" for the attribute (I'd already thought of this). For most
that wouldn't be a problem, but it is in our case, because the boss doesn't
want the users to have to remember anything or to have the possibility of a
typo rendering the page unusable.

However you have confirmed my belief that it would't work as described above,
so I will present him with the answer and he can take it or leave it I guess.

Thanks for your assistance.

Stephanie Sullivan

2005-09-30, 6:21 pm

On 9/30/05 1:16 PM, in article dhjrtf$1mt$1@forums.macromedia.com, "Wallace
Wilcox" <webforumsuser@macromedia.com> wrote:

> Unfortunately, this means that our Contribute users would have to manually
> type in "loadPageTIC();" for the attribute (I'd already thought of this). For
> most that wouldn't be a problem, but it is in our case, because the boss
> doesn't want the users to have to remember anything or to have the possibility
> of a typo rendering the page unusable.


Hmmm... I have a client who has an editable body attribute that he updates
with Contribute. I don't honestly remember the exact steps. But it was quite
simple due to the template. Have you tried the steps in Contribute to see
what's required?

Stephanie Sullivan
Community MX Partner :: http://www.communitymx.com/author.cfm?cid=1008
Team Macromedia for Dreamweaver :: http://tinyurl.com/6huw3
Co-Author .: "Macromedia Dreamweaver MX 2004 Magic" :. New Riders
VioletSky Design :: http://www.violetsky.net

(Inspiration) - ³It's hard to describe. there'll be moments when you get a
spark, a gleam of light, and boom! you're gone. It seems easy. But then it
goes away, and it gets so incredibly hard.² - Robin Williams


Murray *TMM*

2005-09-30, 6:21 pm

Steph:

The problem is that they would have to type that in de novo, as it were. It
would be especially wonderful if there were a 6th parameter type: list.
This would let you define a list of choices, e.g.,

<!-- TemplateParam name="selectThis" type="List" value="choice1, choice2,
choice3, choice4" -->

And then when you go MODIFY | Template Properties, and select this
parameter, you get a select list where you can only make a single selection.

I think this would solve that problem.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(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
==================

"Stephanie Sullivan" <stephanie@communitymx.com> wrote in message
news:BF630754.567C7%stephanie@communitymx.com...
> On 9/30/05 1:16 PM, in article dhjrtf$1mt$1@forums.macromedia.com,
> "Wallace
> Wilcox" <webforumsuser@macromedia.com> wrote:
>
>
> Hmmm... I have a client who has an editable body attribute that he updates
> with Contribute. I don't honestly remember the exact steps. But it was
> quite
> simple due to the template. Have you tried the steps in Contribute to see
> what's required?
>
> Stephanie Sullivan
> Community MX Partner :: http://www.communitymx.com/author.cfm?cid=1008
> Team Macromedia for Dreamweaver :: http://tinyurl.com/6huw3
> Co-Author .: "Macromedia Dreamweaver MX 2004 Magic" :. New Riders
> VioletSky Design :: http://www.violetsky.net
>
> (Inspiration) - ³It's hard to describe. there'll be moments when you get a
> spark, a gleam of light, and boom! you're gone. It seems easy. But then it
> goes away, and it gets so incredibly hard.² - Robin Williams
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews