Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
, , ... 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/
Comment | File | Size | Author |
---|---|---|---|
#5 | html5_base-884034-5.patch | 2.18 KB | mason@thecodingdesigner.com |
Comments
Comment #1
jensimmons CreditAttribution: jensimmons commentedSo — 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.
Comment #2
jensimmons CreditAttribution: jensimmons commentedI switched the call to this:
Comment #3
jensimmons CreditAttribution: jensimmons commentedI did this. Review.
Comment #4
seutje CreditAttribution: seutje commentednot very cool to hardcode this in the page.tpl.php :(
Comment #5
mason@thecodingdesigner.com CreditAttribution: mason@thecodingdesigner.com commentedAgree on the hardcoded conditional comments. Here's a patch that adds a conditional comments function to template.php.
Comment #6
jensimmons CreditAttribution: jensimmons commentedWell, 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.
Comment #7
seutje CreditAttribution: seutje commentedyea, 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
Comment #8
jensimmons CreditAttribution: jensimmons commentedI'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
Comment #9
mbavio CreditAttribution: mbavio commentedHey, 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...
Comment #10
spaceninja CreditAttribution: spaceninja commentedI'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?
Comment #11
jensimmons CreditAttribution: jensimmons commentedWho is "jenny"?
Comment #12
alanburke CreditAttribution: alanburke commentedAny thoughts on using Modernizr as suggested by HTML5 boilerplate?
This includes the HTML shiv for IE.
Comment #13
mbavio CreditAttribution: mbavio commentedSorry, my question was for @jensimmons. Dont know why I wrote Jenny :P
Comment #14
mason@thecodingdesigner.com CreditAttribution: mason@thecodingdesigner.com commentedI like and use Modernizr, but I don't think it's essential to this theme.
Comment #15
jensimmons CreditAttribution: jensimmons commented