PDA

View Full Version : Dreamweaver Template pain!


confused
05-20-2010, 08:30 PM
Hi sorry if this has already been posted, have searched and not found anything to help me.

My problem's a true pain in the posteria. I have a template that has saved with 2 editable regions one in the head and one in the body.

The problem is that when I try to preview the page it is not showing any info that i have placed in the editable areas. Why is this?



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Holder.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>The PC Cure</title>
<script type="text/javascript">
function init()
{
}
</script>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
Active {
display: block;
background-color: #09F;
}

PartCode {
background-color: #CF3;
display: block;
}
Category {
background-color: #9FC;
display: block;
}
Brand {
background-color: #F06;
display: block;
}
Description {
background-color: #3FC;
display: block;
}
Price {
color: #FFF;
background-color: #000;
display: block;
}
PicName {
float: right;
position: relative;
border: thin solid #000;
top: -110px;
background-color: #FFF;
height: 100px;
width: 100px;
}
Item {
position: relative;
width: 350px;
height: 125px;
border: medium solid #333;
display: inline-block;
margin: 25px;
}
-->
</style>
<script type="text/javascript">
function loadItemsForSale()
{
var xmlDoc=new ActiveXObject("MSXML.DOMDocument");
xmlDoc.async="false";
xmlDoc.load("../SaleData/ForSale.XML");
var items=xmlDoc.documentElement;

for (var i = 0; i < items.childNodes.length; i++)
{
var singleitem = items.childNodes(i);
var Item_Element = document.createElement("Item")

for (var j = 0; j < singleitem.childNodes.length; j++)
{
var node = document.createElement(singleitem.childNodes(j).ta gName);
var elemetText = document.createTextNode(singleitem.childNodes(j).t ext);
node.appendChild(elemetText);
Item_Element.appendChild(node);
}
document.getElementById("ItemsForSale").appendChild(Item_Element);
}
}
</script>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
#menu {
float: right;
margin-top: 20px;
margin-right: 50px;
margin-bottom: 0px;
margin-left: 0px;
position: relative;
width: auto;
height: 500px;
}
body {
background-image: url(../Images/background.jpg);
background-repeat: repeat-x;
}
-->
</style>
</head>
<body onload="init()">
<iframe frameborder="0" scrolling="no" allowtransparency="1" id="menu" src="Menu.html"/>
<!-- InstanceBeginEditable name="MainContent" -->
<div id="ItemsForSale"></div>

<p>TEST TEXT</p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd -->
</html>

gentleone
05-20-2010, 09:48 PM
In your css styles in the head you'll have rules that do not define a class (.) or an id (#) and they start with a capital letter which also not good practice.

This one for instance:

Active {
display: block;
background-color: #09F;
}
Shoul be this:

.active {
display: block;
background-color: #09F;
}
or this:

#active {
display: block;
background-color: #09F;
}
Which one it should be I can't see because you load everything in an iframe.

DWcourse
05-20-2010, 10:26 PM
Well the stuff in the head isn't visible on the page anyway and style that are placed in this page won't apply to a separate page that you load in an iframe. That page will need it's own styles (or the two pages could share an external style sheet.

Your TEST TEXT should show though (and did when I tested it.

Corrosive
05-21-2010, 06:00 AM
Why the iframe?

edbr
05-21-2010, 06:49 AM
good question. i dont see the iframe closed either

confused
05-21-2010, 07:55 AM
ok thanks for your replys all. To clarify the css styles dont have dots because the js is going to be placing the elements straight from a xml file. so i was referencing the element name.

I think the iframe is closed at the end of the line "/>", and the stuff in the iframe is displaying correctly. However im not sure that an iframe is the best option. maybe i could try something else to show another page from within my site?

DWcourse, I am slightly mythed that you see the "TEST TEXT", i am not seeing that at all. Guessing it must be either something to with my DW setup or the template page.. any ideas??