Welcome to WebmasterWorld Guest from 54.159.250.110

Forum Moderators: open

Message Too Old, No Replies

Dreamweaver Templates--Am I crazy?

Dreamweaver eating my rollovers! Yum!

   
2:29 am on Apr 28, 2006 (gmt 0)

5+ Year Member



This one's got me stumped.

I create an HTML page from Photoshop (then ImageReady, etc.) and EVERYTHING works fine. I have my main menu on a rollover behavior (white text on dark BG, that "glows" on mouse rollover). When I "Save optimized as..." a HTML, everything is great.

However, once I convert the HTML to a DWT template file in Dreamweaver, everything still looks great and works--everything EXCEPT my glowing rollovers, which become non-existant in a browser.

The strangest part of it to me is that when I dig into my behaviors and code to see if somehow the rollover changes GIF files, I see that it is IDENTICAL to my HTML that I converted from. Let me explain:

" changeImages('t02_08', 'images/t02_08-over.gif') " is the same in the HTML and the DWT, however it ONLY actually changes (does the rollover action) in the HTML.

So then I thought it was something to do with the templates, and it gets converted back over when you make a new HTML page from the template. NOPE! My cool glow never makes it back onto the new HTML pages... It gets lost somewhere, but I don't know where.

Any help would be greatly appreciated! This is the first time I'm using templates and LOVE the idea, but I just can't get it to work.

For reference info, here is the HTML from the DWT, and then the original HTML:

-----
****DWT*****

<a href="#"
onmouseover="changeImages('t02_08', 'images/t02_08-over.gif'); return true;"
onmouseout="changeImages('t02_08', 'images/t02_08.gif'); return true;"
onmousedown="changeImages('t02_08', 'images/t02_08-over.gif'); return true;"
onmouseup="changeImages('t02_08', 'images/t02_08-over.gif'); return true;">
<img name="t02_08" src="../images/t02_08.gif" width="100" height="43" border="0" alt=""></a></td>

***HTML****
<a href="#"
onmouseover="changeImages('t02_08', 'images/t02_08-over.gif'); return true;"
onmouseout="changeImages('t02_08', 'images/t02_08.gif'); return true;"
onmousedown="changeImages('t02_08', 'images/t02_08-over.gif'); return true;"
onmouseup="changeImages('t02_08', 'images/t02_08-over.gif'); return true;">
<img name="t02_08" src="images/t02_08.gif" width="100" height="43" border="0" alt=""></a></td>

9:56 am on Apr 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi rolex

Welcome to webmasterworld [webmasterworld.com] :)

Is the Javascript present in the .DWT?

3:59 am on May 2, 2006 (gmt 0)

5+ Year Member



I don't know how this happened, but for some reason it corrected itself?!? All this was happening around the same time I installed IE7. Do you think that has anything to do with the wierd things going on?
2:49 am on May 17, 2006 (gmt 0)

10+ Year Member



what is happening is that your template is in the templates folder, and so the paths for evertything are relative.

I discovered the same problem when i started using templates, let me guess, the pages that work are in the root folder? the ones that dont are in another

try arsing around with the actual url in the template file

sometimes dreamweaver says an image is

/images/image.jpg

other times

images/images.jpg

that one stupid slash had me for ages!
see if its what has you!

The Del Boy
Live Forever or Die in the attempt

3:16 pm on May 22, 2006 (gmt 0)

10+ Year Member



One word: hierarchy

With library files as with DWT you need to (..images/rollover1.gif/jpg).

5:37 am on Jun 2, 2006 (gmt 0)

5+ Year Member



Yes you are, Dreamweaver templates, although a good theory are more of a headache than they are worth. I used them for several sites until I tried out some server side includes - hands down a better option for the same benefits/behavior.
1:48 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



entrenet:

R U saying you like DWT or dislike? If you dislike, what is your recommendation?

2:09 pm on Jun 2, 2006 (gmt 0)

5+ Year Member



Dislike! They are slower AND more complicated/confusing than, say for example a php include statement which is what I recommend.

Quite frankly, the server side include approach is more correct as well. My opinion is that Dreamweaver templates are simply for those who aren't aware of include statements.

2:26 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



entrenet:

I am aware for this statement and I am using it over JavaScript to control a banner add. JavaScript is not an immediate load as PHP is instantaneous.

Back to DWT. If you use a include PHP include statment, would you need to use different statement for different sections? E.g header, footer etc?

Please show your example.

Thanks.

2:39 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



entrenet:

I did look at my DWT code and all is compliant. Furthermore, the site load less that 7 seconds. One other solution is to use library files. In addtion, a person can copy code from a file (e.g template - not a DWT) and use the that code throughout his/her site for consistency. But one always must rememeber hierarchy (../images/header or ../../images/header).

Your thoughts are appreciated.

2:41 pm on Jun 2, 2006 (gmt 0)

5+ Year Member



Exactly. Whatever sections of the page are exactly the same site wide simply throw into a single file and then include it in all pages.

So yes, header and footer are typical.

------------------------------------------------
Browser rendered html of includes_over_dwt.php would look something like this:

<html>
<body>
<img src="this_site_wide_img.jpg">
<img src="that_site_wide_img.jpg">
<a href="global_nav1.php">Page 1</a>
<a href="global_nav2.php">Page 2</a>
<a href="global_nav3.php">Page 3</a>
<a href="global_nav4.php">Page 4</a>

<p>Here is a paragraph of page specific content.</p>

<p>Site wide footer with copyright info etc.</p>
</body>
</html>

-------------------------------------------------
Before browser rendering of html includes_over_dwt.php would look something like this:

<html>
<body>

<? include ('top_page.php');?>

<p>Here is a paragraph of page specific content.</p>

<? include ('footer.php');?>

</body>
</html>

----------------------------------------------

And of course top_page.php is the following:

<img src="this_site_wide_img.jpg">
<img src="that_site_wide_img.jpg">
<a href="global_nav1.php">Page 1</a>
<a href="global_nav2.php">Page 2</a>
<a href="global_nav3.php">Page 3</a>
<a href="global_nav4.php">Page 4</a>

And footer.php is the following:

<p>Here is a paragraph of page specific content.</p>