5

我有一个基于 html5boilerplate 的Diazo主题文件。主题使用<html>元素上的条件注释来识别 Internet Explorer 的特定版本,例如

<!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]-->

然而,当应用主题时,Diazo 似乎去掉了这些条件注释,只有最后一个

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

留在最终标记中,产生类似

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

具有无与伦比的endif. <html>在标签中使用条件注释(例如<head>在文档内部或更下方)似乎可以正常工作。

有此问题的主题和规则文件的示例可在

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

我正在使用 plone.app.theming 1.0b8 和 good-py 的相关 KGS 版本。

4

2 回答 2

2

这看起来像是 Diazo 中的错误,请将其添加到带有组件“Diazo”的 Plone 错误跟踪器中。

于 2011-09-30T00:57:45.687 回答
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.

于 2012-01-24T12:29:56.293 回答