View Full Version : Path to css file inside conditional statement in dreamweaver template

Dec 13th, 2008, 02:54 PM
I have a conditional statement in my dreamweaver template which loads a specific css file for IE6:

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="menuh_ie.css" />

The problem is the path to this file doesnt get updated when I create a file from the template.

How do I get dreamweaver to update the path - like it does for the regular css file which isnt called from a conditional statement?


Dec 15th, 2008, 01:28 PM
I cant find a solution to this anywhere. I assume there must be a way to do it or how else do I specify an IE only css file when using a dreamweaver template?

Dec 15th, 2008, 11:02 PM
I found this posted here (http://cssforlunch.com/dreamweaver-fails-conditional-comments/):

<!– TemplateParam name=”ie6″ type=”URL” value=”../stylesheets/ie6.css” –>
<!– TemplateParam name=”ie7″ type=”URL” value=”../stylesheets/ie7.css” –>
<!–[if IE 6]><link rel=”stylesheet” href=”@@(ie6)@@” type=”text/css”
charset=”utf-8″ /><![endif]–>
<!–[if IE 7]><link rel=”stylesheet” href=”@@(ie7)@@” type=”text/css”
charset=”utf-8″ /><![endif]–>

But I cant figure out how to use it properly - it doesnt update the link?

Has anyone else come across this?

Pepe, the bull
Dec 15th, 2008, 11:07 PM
If the template is in the template folder, and the css file is in the root folder then you should have . . .

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="../menuh_ie.css" />

. . . or the files you create will look in the templates folder for the file which isn't there. I tested in my Dreamweaver MX and it updates other files when I save the template (even in the conditional statement).

Dec 16th, 2008, 09:34 AM
Thanks for the reply, but its not updating in mine (Dreamweaver 8). If I add "../" inside the conditional statement then all files just have "../" added to the path which means files that are at root level for example have the wrong path to the css file as they wouldnt need the "../".

My Dreamweaver is clearly ignoring anything inside the conditional statement as its treating it as a greyed out comment?

Pepe, the bull
Dec 16th, 2008, 10:25 PM
Just out of curiosity, if you add a regular comment (not the conditional statement), does it add that comment to your files based off that template?

This article talks about an extension to help "file path fixing". I don't have DW8 so I can't really test it.