PDA

View Full Version : Template links broken


Squidweaver
06-10-2009, 12:37 AM
Hi guys,

Thanks for taking time to read my post.

I'm teaching some students in Dreamweaver and one lady is building a website in Dreamweaver, using a simple box model/DIV structure. The navigation DIV contains a SPRY Horizontal menu bar, that She has applied document relative links to all of her pages. The idea was that we could make the navigation in the template, and all of the pages made from that template would use the links applied to the SPRY.

My problem arrives when I test a page made from the template. When I initially hover over the links before clicking, they appear correct in the status bar in Firefox, changing as per the link I specified.

I click on say, the 'news' link, it goes there without a problem, but then when I try to click any other link, all the links seem to point to the news page and not the link I specified.

Im very,very confused. I've made sure all links are document relative, and have linked using the correct html. Here is the Template code:

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Welcome Plaid Ogmore</title>
<!-- TemplateEndEditable -->
<link href="../css/layout.css" rel="stylesheet" type="text/css" />
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
<div id="wrapper">
<div id="header"></div>
<div id="menu">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="../index.html">Home</a> </li>
<li><a href="../news.html">News</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Events</a>
<ul>
<li><a href="#">Surgeries</a></li>
<li><a href="#">Meetings</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Publications</a>
<ul>
<li><a href="#">Manifesto</a></li>
<li><a href="#">Documents</a></li>
<li><a href="#">Newsletters</a></li>
<li><a href="#">Press Releases</a></li>
</ul>
</li>
<li><a href="../test.html">Links</a></li>
<li><a href="#">Gallery</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Contact Us</a>
<ul>
<li><a href="#">Membership</a> </li>
</ul>
</li>
</ul>
</div>
<div id="content"><!-- TemplateBeginEditable name="content" -->
<div id="bottom">
<p class="bodytext">stuff here </p>
</p>
</div><!-- TemplateEndEditable -->



</div>

<div class="bodytext" id="footer">bethan dalton</div>
</div>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
...and here is the code from the index page...


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Welcome Plaid Ogmore</title>
<!-- TemplateEndEditable -->
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
<div id="wrapper">
<div id="header"></div>
<div id="menu">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.html">Home</a> </li>
<li><a href="news.html">News</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Events</a>
<ul>
<li><a href="#">Surgeries</a></li>
<li><a href="#">Meetings</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Publications</a>
<ul>
<li><a href="#">Manifesto</a></li>
<li><a href="#">Documents</a></li>
<li><a href="#">Newsletters</a></li>
<li><a href="#">Press Releases</a></li>
</ul>
</li>
<li><a href="#">Links</a></li>
<li><a href="#">Gallery</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Contact Us</a>
<ul>
<li><a href="#">Membership</a> </li>
</ul>
</li>
</ul>
</div>
<div id="content"><!-- TemplateBeginEditable name="content" -->
<div id="content">


<div id="left">

<h>
<img src="images/heading.jpg" alt="Welcome" width="498" height="76" />
<p>Welcome to the website of Plaid Cymru in the Ogmore constituency.<br>
Here you will find the latest news of what Plaid Cymru is doing for you locally, nationally and internationally.<br>
If you want to know more about Plaid Cymru, its policies and aims please follow the links on this page. <br>
If you have an issue locally you want to draw to our attention, drop us an email or give us a call and one of our team will get back to you.<br>
If you would like to join Plaid Cymru or receive details of our regular meetings please feel free to contact us. </p>
</div>


<div id="right"><img src="images/constituencymap" alt="Ogmore" width="276" height="338" align="right" /></div>


<div id="bottom">
<p class="bodytext"><img src="images/news.jpg" width="498" height="76" alt="news" /></p>
<p class="date"><img src="images/smallflower.png" alt="smallflower" width="28" height="28" align="absbottom" />May 24, 2009
<p class="date"><span class="titlenews"> Plaid MEP is Wales’ hardest working</span><br>
<p class="bodytext">Official figures published by the European Parliament show that Plaid MEP Jill Evans has the best attendance at full sessions of the European Parliament of any of the four MEPs from Wales.... </p>

<p class="date"><img src="images/smallflower.png" alt="smallflower" width="28" height="28" align="absbottom" />May 24, 2009
<p class="date"><span class="titlenews">Plaid Minister launches more regular train service for Merthyr</span><br>
<p class="bodytext">Plaid Minister for the Economy and Transport, Ieuan Wyn Jones AM, has today launched a more regular train service ... </p>


<br>
<br>
</div>
</div><!-- TemplateEndEditable -->



</div>

<div class="bodytext" id="footer">bethan dalton</div>
</div>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
I hope someone can help, as I'm baffled :confused::confused::confused:

Thank you | M

coloeagle
06-10-2009, 12:41 AM
You only have two real links in your menu. The index page and the news page. <a href=#"> is a filler type link and will just refresh the current page being viewed.

Squidweaver
06-10-2009, 12:48 AM
Hi coloeagle,

Yes sorry, I should have mentioned that, I was only testing with the 2.

I just made a fresh index, and made 3 dummy pages directly from the template, linked them all, and it just worked fine. It seems that one of the pages wasn't made from the template (I think the index) and somehow that must have messed everything up.

It was strange, because the same thing happened to another student, and that made things worse...very odd.

It's hard to get your head around things like that sometimes :-)

M

coloeagle
06-10-2009, 12:54 AM
Since your using a template, you could place your menu inside the template rather than each individual page. This way you are insured the menu will be the same on each page.

DWcourse
06-10-2009, 01:28 AM
If a document relative link is in an editable region, Dreamweaver won't "fix" it when you create a page from the template. If it's in a template (or locked) region, Dreamweaver will update it.

One problem I find that student have is they don't understand how a template works. To make a new page, they open the template and do a Save As… That's a sure way to cause problems.