This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > March 2004 > <Body> Editable region in template
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 |
<Body> Editable region in template
|
|
| kmorton 2004-03-30, 8:59 pm |
| [b]How can I make the <Body> tag an editable region in my templates in DW2004?
[/b]
I need to add an onload="" function in the body tag for just one page, but I
can't because this tag is not editable. I do not want this function on every
page either. What do I do?
[b]Please[/b] help me and please be descriptive because I've only been using
DreamWeaver for a month now. Thanks for any help you can give! : )
| |
| Murray *TMM* 2004-03-30, 8:59 pm |
| Show me what you want the body tag to look like please.
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"kmorton" <webforumsuser@macromedia.com> wrote in message
news:c4cml7$pbn$1@forums.macromedia.com...
> [b]How can I make the <Body> tag an editable region in my templates in
DW2004?
> [/b]
>
> I need to add an onload="" function in the body tag for just one page,
but I
> can't because this tag is not editable. I do not want this function on
every
> page either. What do I do?
>
> [b]Please[/b] help me and please be descriptive because I've only been
using
> DreamWeaver for a month now. Thanks for any help you can give! : )
>
| |
| mzanime.com 2004-03-30, 8:59 pm |
| Well the lazy mans solution would be to just "detach" that 1 page from the
template.
Or you could put some dynamic code in the <body> tag and have it only display
if the current URL (variable) is true. That is, if you are using a dynamic
site.
| |
| kmorton 2004-03-30, 9:00 pm |
| What type of IF then statement would I use for tracking a URL? I'm writing the website in ASP... but I've never used the URL as a variable... <sigh>
| |
| Anton_FA 2004-03-30, 9:00 pm |
| can make that attribute editable.
that is the better way to do it rather than having the whole body editable.
If you want the whole body editable then there is no point in having a template.
| |
|
|
| Murray *TMM* 2004-03-30, 9:00 pm |
| That is indeed a lazy man's solution, and a poor one, too.
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"mzanime.com" <webforumsuser@macromedia.com> wrote in message
news:c4cndb$qag$1@forums.macromedia.com...
> Well the lazy mans solution would be to just "detach" that 1 page from the
> template.
>
> Or you could put some dynamic code in the <body> tag and have it only
display
> if the current URL (variable) is true. That is, if you are using a
dynamic
> site.
>
| |
| Murray *TMM* 2004-03-30, 9:00 pm |
| <body>, not 'body'. There is no way to make the body tag editable.
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Anton_FA" <webforumsuser@macromedia.com> wrote in message
news:c4cnnk$qme$1@forums.macromedia.com...
> can make that attribute editable.
>
> that is the better way to do it rather than having the whole body
editable.
>
> If you want the whole body editable then there is no point in having a
template.
| |
|
|
| Murray *TMM* 2004-03-30, 9:00 pm |
| But you can make attributes of the body tag editable. However, if the OP
can show me how he wants to modify the body tag, I can perhaps show him how
to do it without even doing that.
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:c4cnsb$qvm$1@forums.macromedia.com...
> <body>, not 'body'. There is no way to make the body tag editable.
>
> --
> 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.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
> "Anton_FA" <webforumsuser@macromedia.com> wrote in message
> news:c4cnnk$qme$1@forums.macromedia.com...
> editable.
> template.
>
>
| |
| kmorton 2004-03-30, 9:00 pm |
| By making the attribute editable will it by default put the function on all the pages that uses that template?
| |
| Anton_FA 2004-03-30, 9:00 pm |
| [q][i]Originally posted by: [b][b]Newsgroup User[/b][/b][/i]
That is indeed a lazy man's solution, and a poor one, too.
>[/q]
wow thats really helpful.
| |
| Murray *TMM* 2004-03-30, 9:01 pm |
| Anton:
Perhaps, but true. Anytime you need to detach a page from the template to
do something, it means that you have not understood how to use templates
correctly, or you have not used them properly. I'm desparately trying to
find out how the original poster wanted the body tag modified, and when he
responds, I'll tell you how to do that. Or do you want more info now?
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Anton_FA" <webforumsuser@macromedia.com> wrote in message
news:c4cp3q$sle$1@forums.macromedia.com...
> [q][i]Originally posted by: [b][b]Newsgroup User[/b][/b][/i]
> That is indeed a lazy man's solution, and a poor one, too.
>
>
> wow thats really helpful.
>
>
| |
| Anton_FA 2004-03-30, 10:30 pm |
| Hi Murray.
I think I'm mistaken. I thought there was some way to have tag attributes
editable.
Perhaps I was thinking of optional regions.
Anyway, I was just interested to see what your solution is?
cheers
| |
| Murray *TMM* 2004-03-30, 10:31 pm |
| Anton:
Sure you can have tag attributes editable. You can make any attribute of
any tag editable.
If kmorten would post back and tell me what he wants to do, how he wants to
modify the body tag, etc., I'll tell him EXACTLY how to do it.
In general there's the easy way, and the more general way. The easy way is
like this...
Here's a body tag with a simple behavior applied -
<body onLoad="MM_popupMsg('Hello World')">
If this were in a template page, it would appear in EVERY child page, and
that may not be what we want. So, you can either make the onLoad attribute
of the body tag editable, or you can do this very simple thing. In the
desired child page, make the editable region in the head of the document
like this -
<!-- InstanceBeginEditable name="head" -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
<!-- This is the DW js for the popupMessage behavior -->
<!-- and what comes next will invoke that behavior -->
MM_popupMsg('Hello World')
</script>
The body tag on that child page would then be unchanged -
<body>
See what I mean?
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Anton_FA" <webforumsuser@macromedia.com> wrote in message
news:c4d2jv$ak9$1@forums.macromedia.com...
> Hi Murray.
>
> I think I'm mistaken. I thought there was some way to have tag
attributes
> editable.
> Perhaps I was thinking of optional regions.
>
> Anyway, I was just interested to see what your solution is?
>
> cheers
>
| |
| kmorton 2004-03-31, 1:33 pm |
| This is what I wanted on the default page only:
<body onload="initImgRotation()">
| |
|
|
> This is what I wanted on the default page only:
>
> <body onload="initImgRotation()">
<script language="JavaScript" type="text/JavaScript">
<!--
function p7runIt(){ //v1.0 PVII
initImgRotation();
}
onload=p7runIt;
//-->
</script>
older msg:
put a script in an editable area of the head section that does nothing
but trigger the function call you want.
older msg pasted:
you can make a javascript function in an editable region in the head that
calls the functions you want. That means you don't have to put the onLoad
into the body tag...
reference this for some details:
http://projectseven.com/faqbase/faq...body&pg=1&id=18
make an editable region in the head section of the template, below the other
functions you are calling (so they 'exist' to the browser before the runit
function calls them)
insert this into it in the child pages:
<script language="JavaScript" type="text/JavaScript">
<!--
function p7runIt(){ //v1.0 PVII
MM_Preload(image1.gif,image2.gif);
}
onload=p7runIt;
//-->
</script>
Change this line:
MM_Preload(image1.gif,image2.gif);
to call the function you want.
Additional functions? Add them on add. lines, ending with a ;
as long as that is in an editable area, you can change it on each child page
so it does what you want
| |
| Murray *TMM* 2004-03-31, 1:36 pm |
| kmorton:
OK - in that page only, make your body tag like this -
<body>
and in the editable region in the head, paste -
1. The function declaration for the initImgRotation() function, and then
2. The following line immediately after #1 -
initImgRotation()
Your final page would look like this -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
....
<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript">
<!--
function initImgRotation() {
....
}
initImgRotation()
//-->
</script>
....
</head>
<body>
....
</body>
</html>
--
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.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"kmorton" <webforumsuser@macromedia.com> wrote in message
news:c4epau$jm0$1@forums.macromedia.com...
> This is what I wanted on the default page only:
>
> <body onload="initImgRotation()">
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|