5

I have a Diazo theme file which is based on the html5boilerplate. The theme uses conditional comments on the <html> element to identify particular versions of Internet Explorer, e.g.

<!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]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

However, when the theme is applied Diazo seems to strip away these conditional comments and only the last

<!--<![endif]-->

is left in the final markup producing something like

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en" xml:lang="en"><!--<![endif]-->

with an unmatched endif. Using conditional comments within the <html> tag (e.g. inside <head> or further down in the document) seems to work fine.

Examples of a theme and rules files which have this issue are available at

https://github.com/hexagonit/hexagonit.themeskel/blob/master/hexagonit/themeskel/templates/less_theme/+namespace_package+/+package+/theme_resources

I'm using plone.app.theming 1.0b8 with the associated KGS versions from good-py.

2 Answers2

2

This looks like a bug in Diazo, please add it to the Plone bug tracker with component 'Diazo'.

Laurence Rowe
  • 2,909
  • 17
  • 20
0

A work around for this could be to use conditional comments on the <body> tag, but Diazo must also add a few classes to the body tag for Plone, which would break it in <=IE8.

<merge attributes="class" css:theme="body" css:content="body" />

So a 3rd rate work around could be to use contional comments on a div block like this.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="css/style.css">
  <title>Title</title>

</head>
<body>
  <!--[if lt IE 7]> <div class="no-js ie6 oldie"> <![endif]-->
  <!--[if IE 7]> <div class="no-jsie7 oldie"> <![endif]-->
  <!--[if IE 8]> <div class="no-js ie8 oldie"> <![endif]-->
  <!--[if gt IE 8]><!--> <div class="no-js"> <!--<![endif]-->

    <div id="content"></div>

  </div><!-- Browser Detection -->
</body>
</html>

Given the general fuglyness of Plone's generated html, I could live with this.

Craig552uk
  • 651
  • 1
  • 5
  • 15