willnjen
asked on
Expression Web dwt and the body tag
Hi Experts
I use Microsoft Expression Web and always use Dynamic Web Templates. I have a problem I can't figure out. I need an ID on the body tag of each page for the menu CSS to reference. Something like this.... <body id="contact">
So I need to edit each page to change the ID. So I thought I'd make that body tag as an editable region in the DWT. Something like this...
<!-- #BeginEditable "bodyid" -->
<body id="contact">
<!-- #EndEditable -->
My problem is it appears Expression will not allow a Editable region around the body. It does update pages but overwrites content on the pages with content from the template. Esentially it's ignoring the editable region.
See my problem?
Have a look at this screen shot. Only 1 editable region when there should be 2.
Any thought?
example.png
I use Microsoft Expression Web and always use Dynamic Web Templates. I have a problem I can't figure out. I need an ID on the body tag of each page for the menu CSS to reference. Something like this.... <body id="contact">
So I need to edit each page to change the ID. So I thought I'd make that body tag as an editable region in the DWT. Something like this...
<!-- #BeginEditable "bodyid" -->
<body id="contact">
<!-- #EndEditable -->
My problem is it appears Expression will not allow a Editable region around the body. It does update pages but overwrites content on the pages with content from the template. Esentially it's ignoring the editable region.
See my problem?
Have a look at this screen shot. Only 1 editable region when there should be 2.
Any thought?
example.png
ASKER
Hi Jason
I see what you are saying about getting the Body ID to reference a value in the head. I just can't get the syntax correct to make it work. Have a look at my code below. The value "home" does seem to be assigning to the body id.
Is it laid out correctly?
Cheers
Will
I see what you are saying about getting the Body ID to reference a value in the head. I just can't get the syntax correct to make it work. Have a look at my code below. The value "home" does seem to be assigning to the body id.
Is it laid out correctly?
Cheers
Will
<!-- #BeginEditable "bodyid" -->
TemplateParam name="id" type="text" value="home"
<!-- #EndEditable -->
</head>
<body id="@@(id)@@">
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your sample code was incorrect, but apparently it doesn't matter now.
You can't surround the body tag as an editable region.
>> So I need to edit each page to change the ID.
You should be making the required change in the DWT and it will then update the child pages. If the id has to be different on each page, then you need to make just the id attribute editable.
Open in new window