-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dreamweaver templates and IE conditionals / possible solutions #856
Comments
So this is basically a dreamweaver bug so I'm somewhat prone to close it as theirs. Maybe you can report it to them? |
OK i will report to Adobe. |
@supup, although this is a dreamweaver bug, this information saved me! |
@supsup This fix also saved me! I probably would have spent hours trying different hacks, or reverted to ie-specific stylesheets. Thank you for posting these solutions! |
FWIW, this is fixed in the next version of Dreamweaver. Dreamweaver will see the final html in the IECC's and put the template comment right after that. The template instance code will end up looking like:
I would actually like the instance comment outside that last IECC but that was a lot more work to change in DW because a lot of places expected it right inside the html tag. For people using Dreamweaver 5.5 and earlier, another work around is in the template page to use the directive form of downlevel-revealed.
You'll get the same results as above because Dreamweaver will parse those IECCs as documented by microsoft at http://msdn.microsoft.com/en-us/library/ms537512.aspx. |
you rock @chrisbank |
Help please. I'm trying to figure this out, and I just can't get it. IE9 is the only one not reading my Dreamweaver html5 site (using a template). I tried above, but my understanding of the syntax isn't there yet apparently. Does the Paul Irish comment go away? When I paste what @supsup said, and save the template, Dreamweaver gives me an error message that says I need to add the following in the head section: '' When I do it, it still adds the following before the <!doctype html> on all the files created using the template: '' Do I use another editor to modify the template file and then reopen in Dreamweaver? If so, can you please cut & paste the exact code I need to tweak? Please and thank you. |
You don't put that inside the template what i have listed is a page generated from a template. or at least I think not at my work computer at the moment. Inside the template you can add a tag to lock the content before the head (highly suggested -- or peopel will add crap before doctype and then throw stuff into quirks mode.) set your template up like this: <!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8 | !(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<head>
.... OR <!doctype html>
<html>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<head>
...
</head>
<!--[if lt IE 7]> <body class="no-js ie6 oldie"> <![endif]-->
<!--[if IE 7]> <body class="no-js ie7 oldie"> <![endif]-->
<!--[if IE 8]> <body class="no-js ie8 oldie"> <![endif]-->
<!--[if gt IE 8 | !(IE)]><!--> <body class="no-js"> <!--<![endif]-->
.... |
I'm still wondering if the Paul Irish line of code has to go away completely or not? This is what I have based on @chrisbank's suggestion, but I don't know if it works for IE7 and IE9 too? I'm fumbling... Here's what I have: '<!doctype html> <![if gt IE 8]><![endif]> ... ' Thanks for responding, truly appreciated. |
Hey guys, just found a way to avoid this Dreamweaver bug.
|
Hallelujah! Thanks nicolasmn! This worked! I already had the conditional elements on the page and didn't want to clutter my code. Simply added the parentheses around the IE version! whala! MUCH appreciated! =) Quickest forum search with an actual resolution to date! What a relief. |
When you generate a page from a template in Dreamweaver it should insert a comment after the
<html>
tag like this:the problem:
Confuses Dreamweaver, it basically cannot find the html tag so it freaks out and puts it's comment before the doctype like this:
which throws browsers into quirks mode.
from location:
http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
I tried the following solution. Both appear to work, unsure which one is better or if there is another solution:
having the following in the template :
results in the following generated pages:
kind of odd look but perhaps this is the best solution.
Also tried moving conditionals to body like this:
which appears to work fine as well and has the benefit of not having a odd comment at top inside the conditionals.
Thinking about going with the conditional html version (closer to OG html5 boilerplate) but was uncertain if having the extra comment added there would cause any issues?
The text was updated successfully, but these errors were encountered: