Posted by jensimmons on August 16, 2010 at 12:24am
| Project: | HTML5 Base |
| Version: | 6.x-1.0-beta1 |
| Component: | Markup |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
, , ... how to we make IE *see* them. So we can write CSS to them, and have it work?
We use this js: http://remysharp.com/2009/01/07/html5-enabling-script/
Comments
#1
So — I'm going to implement this in page.tpl, so that it can be conditional, and only load for IE.
<!--[if IE]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->Right now, I'm going to make it link to the file on googlecode. This:
1) keeps a 3rd party thingy out of Drupal CVS;
2) allows themes to get an update automatically if Remy Sharp every updates that code.
-OR-
We can instead include the js file ourselves. That's what Boron does. (http://drupal.org/project/boron)
Thoughts?
I'm going to commit the 1st solution (so that it works). Let's discuss and we can change it if we decide we want the second option.
#2
I switched the call to this:
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->#3
I did this. Review.
#4
not very cool to hardcode this in the page.tpl.php :(
#5
Agree on the hardcoded conditional comments. Here's a patch that adds a conditional comments function to template.php.
#6
Well, in D6, all the other if IE stylesheets have to be hardcoded into the page.tpl. (Oh, actually in D7 too since the PHP coders beat the front-end developers in the debate, and refused to put conditional stylesheets into core. :( Really IE stylesheets should be defined in the .info file. #522006: Conditional Styles in .info files, since drupal_add_css has it) So I don't see how doing this one in that way is any different.
If it's in the template.php, it's harder for people to figure out where it's coming from. This is not the most-used technique for conditional IE stylesheets.
#7
yea, but no way ur getting that backported to 6, it's an obvious feature.
u could make like Zen and carry the code for it around yourself -> http://drupalcode.org/viewvc/drupal/contributions/themes/zen/zen/templat... (this is for css, but js would work exactly the same), then u can happily put it in the .info and then subthemes can swap it out if they want without being forced to override the whole tpl.php
#8
I'm not advocating we add Conditional Stylesheets to D6. :P
I'm saying that I don't want to hide the inclusion of the conditional HTML5 IE .css in the template preprocess. I'd prefer to just print it in the page.tpl like all other conditional css.
Oh, wait. This is about .js.
#jetlag
#9
Hey, this is my first comment here, it's just a question to jenny: why not to do as zen does (seutje already adviced that) so you can include the conditional js and css from the .info file. Seems like the best "drupal" way of doing this...
#10
I'll second this request - I was looking to copy that code for Boron, as well. Does anyone know of a reason we shouldn't do this?
#11
Who is "jenny"?
#12
Any thoughts on using Modernizr as suggested by HTML5 boilerplate?
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->039. <script src="js/modernizr-1.5.min.js"></script>
This includes the HTML shiv for IE.
#13
Sorry, my question was for @jensimmons. Dont know why I wrote Jenny :P
#14
I like and use Modernizr, but I don't think it's essential to this theme.
#15