Forum Moderators: open

Message Too Old, No Replies

linked DHTML files to template not working

         

josie

3:11 pm on Jan 27, 2003 (gmt 0)



hello,

Please excuse my non-use of correct terminology but I'm new to all this stuff. I'm learning Dreamweaver (4) for work & here's the latest muddle I've got myself into...

I have used some DHTML code to create a drop down menu. There is a bit of code in my file linking it to all the info on 2 external files.
This works fine in a single document that's not created from a template but every page in the site I'm making has been made from a template - the menu is not there on any of them.

I have tried:
-putting the code into a template and updating all related files - doesn't work
-putting the code into each file individually - doesn't work (just highlights it all pale yellow as though it's part of the template code)
-copied everything from the single file that does work and pasted it to replace everything in the template - doesn't work
-taken out any other DHTML code from my document so there's nothing but tables, cells & inserted images so no code can be interfering with it - doesn't work
-changed the box area where the menu should be from editable, to non-editable, back to editable region -still doesn't work
-tried to detach a file from the template to see if that's the problem - not available as an option for some reason

My Dreamweaver manual says external sheets are the best option to use when using templates & I just can't figure out where I'm going wrong

Any ideas/suggestions...?

BlobFisk

4:38 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, josie! Check out Marcia's excellent WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com].

Could you post the code that is causing the problem? It is the code that links to the external .js and .css files? Bright yellow highlighting in Dreamweaver generally means that there is a code error (unclosed tag, no closing " ...). A short snippet will help us to sort this for you! Also, checking that the path that you are using to link to the external files is correct also, if this is wrong then they will not be found by the browser and your dHTML will not work.

josie

4:54 pm on Jan 27, 2003 (gmt 0)



It's not highlighted bright yellow like it's wrong, but everything that's in a file made from a template is highlighted pale yellow (apart from the editable regions)

here's the code for the template document:

<html>
<head>

<style>
<!--
a{text-decoration:none}
//-->
</style>

<!-- #BeginEditable "doctitle" -->
<title>Company Handbook</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
table { text-decoration: none}
-->
</style>
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW ¦¦ innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#9999CC" background="../images/backgblur.gif" vlink="#9999CC" alink="#9999CC">
<script type='text/javascript'>

//HV Menu v5- by Ger Versluis (http://www.burmees.nl/)
//Submitted to Dynamic Drive (http://www.dynamicdrive.com)
//Visit [dynamicdrive.com...] for this script and more

function Go(){return}

</script>
<script type='text/javascript' src='menu/josiemenu.js'></script>
<script type='text/javascript' src='menu/menu_com.js'></script>
<noscript>Your browser does not support script</noscript>

<table width="795" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="81" height="62" valign="top"><a href="../comphandhome.htm"><img src="../images/wave.gif" width="80" height="60" border="0"></a></td>
<td width="69"></td>
<td width="10"></td>
<td width="303"></td>
<td valign="top" colspan="3"><FONT FACE="Verdana, Arial, Helvetica, sans-serif" SIZE="6" COLOR="#3399CC">
Company Handbook</FONT></td>
</tr>
<tr>
<td height="37"></td>
<td></td>
<td></td>
<td></td>
<td width="152"></td>
<td WIDTH="4"></td>
<td WIDTH="176"></td>
</tr>
<tr>
<td height="350" colspan="2" valign="top"><!-- #BeginEditable "menu" -->
<div id='MenuPos' style='position:relative; width 150; height:350;'> </div>
<!-- #EndEditable --></td>
<td></td>
<td colspan="2" rowspan="4" valign="top">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="20" height="21" background="../images/v.gif" ><img src="../images/v.gif" width="20" height="21"></td>
<td width="412" background="../images/x.gif" ><img src="../images/x.gif" width="412" height="21"></td>
<td width="20" valign="top" background="../images/t.gif" ><img src="../images/t.gif" width="20" height="21"></td>
<td width="3" ></td>
</tr>
<tr>
<td height="68" background="../images/w.gif" ><!-- #BeginEditable "txtbdr1" --><!-- #EndEditable --></td>
<td valign="top" bgcolor="#FFFFFF" ><!-- #BeginEditable "textbox" -->
<p>&nbsp;</p>
<!-- #EndEditable --></td>
<td valign="top" background="../images/y.gif" ><!-- #BeginEditable "txtbdr2" --><!-- #EndEditable -->&nbsp</td>
<td ></td>
</tr>
<tr>
<td height="21" valign="top" background="../images/s.gif" ><img src="../images/s.gif" width="20" height="21"></td>
<td valign="top" background="../images/z.gif" ><img src="../images/z.gif" width="412" height="21"></td>
<td valign="top" background="../images/u.gif"><img src="../images/u.gif" width="20" height="21"></td>
<td></td>
</tr>
</table>
<div style="background:#FFFFFF"></div>
</td>
<td colspan="2" valign="top" rowspan="2"><img src="../images/appblobs.gif" width="180" height="404"></td>
</tr>
<tr>
<td height="54"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="11"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="30"></td>
<td></td>
<td></td>
<td colspan="2" valign="top"><!-- #BeginEditable "longbox" --><!-- #EndEditable --></td>
</tr>
<tr>
<td height="62" valign="top" colspan="3"><!-- #BeginEditable "botbox" --><!-- #EndEditable --></td>
<td colspan="2" valign="top"><!-- #BeginEditable "bottomspace" --><!-- #EndEditable --></td>
<td></td>
<td valign="top"><img src="../images/AppStationLogoSmall.JPG" width="176" height="62"></td>
</tr>
</table>
</body>
</html>

This is EXACTLY the same as the code in a single file that has nothing to do ith the template. The menu on the single file works in my browser but not on the template or any of the files linked/updated from it.
This is why I know there's nothing wrong with the links or the external sheets.

Is there some reason that I shouldn't be applying this to a template?
I've not read anything saying it won't work...

BlobFisk

5:03 pm on Jan 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm... A couple of things that struck me from your code:

There is no template specified on the page, eg <!-- #BeginTemplate "/Templates/myTemplate.dwt" -->.

Your images seem to be going up a level ../images/, but your menu scripts are not ('menu/josiemenu.js'). Are your images folder and menu folder on the same directory level? If so, then I think that this could be the root of your problem.

josie

5:22 pm on Jan 27, 2003 (gmt 0)



I've put the <template...etc> into the top of my template

and did you mean to just put ../ in front of the "josiemenu" file?

This is what I've done but still no success.

and the code I posted you worked as it was in a file that was nothing to do with the template.

hopefully some sleep will make things clearer in the morning.....