PDA

View Full Version : What is X Body - problem with spry menu placement


LaserSailor
02-08-2010, 10:36 AM
I am using spry menu bar in a template of my main page header and all is good until I try to make the body class editable. At that point dreamweaver remames the body class to x body and things like the placement of my spry menu bar quit working. I try to rename x body back to body and there is no way to do that that I can find.

I did find a work around by creating a new class named body and just abandoning the x body class and leaving it in the code, but that seems sloppy.

Any ideas about what is happening would be appreciated.

DWcourse
02-08-2010, 09:01 PM
Do you mean you have a CSS style rule (named body) to define the properties of the body tag? And you'd like that rule to be editable? Can you post your page and give us a link?

LaserSailor
02-13-2010, 02:13 AM
Yes, there is a style, which is created when I create a single column fixed header footer page in Dreamweaver. Yes, I want to make this style editable. What I am trying to do is to create a template of a page with my header, including spry menu and footer. Then I want to create a nested template with 2 colums. In order to do this, I have to make the body class editable so I can change it to a 2 column. I do not have this page posted yet so here is the code.

</style>
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<!-- TemplateParam name="class" type="text" value="oneColFixCtrHdr" -->
</head>
<body class="@@(_document['class'])@@">
<!-- TemplateBeginEditable name="meta-data" -->
<!-Add META Tags here-->
<!-- TemplateEndEditable -->
<div id="container">
<div id="header">
<h1><img src="../images/photos/oregon-coast-menu-bar.jpg" width="780" height="147" alt="oregon-coast" /></h1>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="#">Home</a> </li>
<li><a href="../about-us.html">About Us</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Products</a>
<ul>
<li><a href="#">Products</a> </li>
<li><a href="#">Services</a></li>
<li><a href="#">How to Order</a></li>
</ul>
</li>
<li><a href="#">Contact Us</a> </li>
</ul>
</div><!-- end #header -->

DWcourse
02-13-2010, 02:32 AM
It looks like you had a problem when you set up the editable attribute in the template. I'd go back to the template, delete it and start over.

To insert the editable attribute in the template:

1. Make sure the body tag is selected in the status bar at the bottom of the Document window.
2. Menu: Modify>Templates>Make Attribute Editable…
3.For "which attribute of the BODY tag should be editable click the Add button and type in "CLASS" and click OK.
4. Leave make attribute editable checked.
5. For label type in "bodyclass" or another name for the varialbe.
6. For type choose text
7. For default value type "body" or the name of another style.
8. Click OK.

In the head of the template you should see this:

<!-- TemplateParam name="bodyclass" type="text" value="home" -->

and this in the body tag:

<body class="@@(_document['bodyclass'])@@">

When you create a page based upon the template you should see this in the body tag:

<!-- InstanceParam name="bodyclass" type="text" value="home" --> (you'll notice this is missing in the code you posted)

and this for the body tag (which will not be editable):

<body class="home">

To change the class for the body tag, you will need to go to menu: Modify>Template Properties then in the dialog select "bodyclass" from the list and type in a new value into the bodyclass field at the bottom of the dialog.