Click to See Complete Forum and Search --> : How to set ID to body tag in a template


Inga.
08-28-2010, 06:56 PM
I have tried to figure this issue out before, but ended up working around it. Of course, it is back now. The issue:

I set up a css menu with a three state rollover sprite (static, hover and active). I have read how to set up the menu so it works properly. The one issue I run into is this. I use Dreamweaver and work from a template. All methods I can find for showing the active state on the menu for a specific page want me to id the <body> with an id I've created for each page.

This is fine so far, but with how the Dreamweaver template works, in order to edit the <body> on each page, I have to set it as an editable zone. If I do that, then everything between the <body></body> gets set as an editable zone. This means that no updates to the template will affect any existing page and this obviously makes it pointless to have a template at all.

A code example illustrating the problem:

<head>
<style type="text/css">
#some {css menu code with offset for sprite depending on states}
#ingenting li.ingenting a {background-position: left bottom;}
</style>
</head>

<!-- TemplateBeginEditable name="body" -->
<body id="ingenting">
<div id="wrapper">
<ul id="nav">
<li class="ingenting"><a href="../ingenting.html" title="Ingenting">Ingenting</a></li>
</ul>
</div>
</body>
<!-- TemplateEndEditable -->


As you can see, if I set this editable area in there, it destroys the point of the template. So, is there a cute css trick to do this with Dreamweaver and templates so the "editable region" around the body doesn't create this problem?

And, for the future, is there a better programme to use for making websites with template control that would handle this sort of thing better? I just use Dreamweaver because that's what we have.

Fang
08-29-2010, 02:31 AM
And, for the future, is there a better programme to use for making websites with template control that would handle this sort of thing better?
Any server side language can simply insert the correct id value according to the page name.