HTML5 and IE<9

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

HTML5 and IE<9

Post by cmb » Fri Dec 07, 2012 7:41 pm

Hello Community,

time is passing and HTML5 is spreading more and more. It has even reached the CMSimple world: at least three of the active template providers are publishing templates with the HTML5 Doctype. I foresee that plugins and editors using resp. supporting new HTML5 elements will follow over time (well, actually there are already at least one plugin and one editor).

But there's a problem: IE < 9 (which has a very high market share) doesn't support those new HTML5 elements---they cannot be styled. Fortunately there's a solution (at least if JS is enabled): HTML5 Shiv. So I suppose plugins and end-users to make use of it in the near future (if not even yet). This could easily lead to multiple inclusion of the script. I don't expect the same problems as with jQuery (where multiple inclusion doesn't only waste resources, but will wipe out already defined jQuery plugins), but it might nonetheless be a good idea to develop a plugin[1] and declare this as recommended way to use HTML5 Shiv for CMSimple.

What do you think about it?

[1]
The plugin could consist of a single init.php (+ the HTML5 Shiv scripts + the boilerplate):

Code: Select all

<?php


$hjs .= '<!--[if lt IE 9]><script src="' . $pth['folder']['plugins']
    . 'html5shiv/html5shiv' . ($print ? 'printshiv' : '')
    . '.js"></script><![endif]-->';

?>
It would have to be used by calling:

Code: Select all

include_once $pth['folder']['plugins'] . 'html5shiv/init.php'; 
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1660
Joined: Wed Dec 17, 2008 5:08 pm

Re: HTML5 and IE<9

Post by svasti » Fri Dec 07, 2012 7:59 pm

seems to be a good idea

manu
Posts: 1092
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: HTML5 and IE<9

Post by manu » Sat Dec 08, 2012 10:30 am

This is close related to the template, but it would be nice to have a place holding this. It's just important to control the order.

Code: Select all

	<?php echo head();?>
	<!--[if lte IE 7]>
	<link href="<?php echo $pth['folder']['template'];?>css/patch.css" rel="stylesheet" type="text/css" />
	<link href="<?php echo $pth['folder']['template'];?>css/yaml/core/iehacks.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	<!--[if lt IE 9]>
	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
manu

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: HTML5 and IE<9

Post by cmb » Sat Dec 08, 2012 12:56 pm

Hi manu,
https://code.google.com/p/html5shim/ wrote:It must be included before the <body> element (i.e. in the <head>) but doesn't matter if it appears before or after the CSS - but for the sake of performance, it would make better sense to include the CSS first then this script.
Is the order of the inclusion really important? Have you tested including the shiv directly after "echo head()" or even before it?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

manu
Posts: 1092
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: HTML5 and IE<9

Post by manu » Sat Dec 08, 2012 1:29 pm

No, for the shiv it's not important. But for the IE specific style sheets.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: HTML5 and IE<9

Post by cmb » Sat Dec 08, 2012 1:47 pm

Ah, so you're suggesting to also include these stylesheets automatically? Where does the first one come from?
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply