How to do conditional comments in drupal?
<!-- Additional IE/Win specific style sheet (Conditional Comments) -->
<!--[if IE]>
<style type="text/css" media="all">@import "files/tabs-ie.css";</style>
<script type="text/javascript" src="files/DOMAssistantCompressed-2.7.4.js"></script>
<script t开发者_运维技巧ype="text/javascript" src="files/ie-css3.js"></script>
<![endif]-->
..
<!--[if IE 7.0]>
<link rel="stylesheet" href="files/ie-7.css" type="text/css" media="all" charset="utf-8" />
<![endif]-->
How to do the above in drupal?
I suggest you use http://drupal.org/project/conditional_styles. Enable the module and then place the following in your theme .info file.
; Set the conditional stylesheets that are processed by IE.
conditional-stylesheets[if lt IE 7][all][] = ie6-and-below.css
conditional-stylesheets[if IE 7][all][] = ie7.css
If your theme is based on Zen then this is already built in.
Some of these:
http://drupal.org/node/171205
http://api.drupal.org/api/function/drupal_set_html_head/6
http://api.drupal.org/api/function/drupal_add_js/6
http://api.drupal.org/api/function/drupal_add_css/6
Also by modify pageXXX.tpl.php in your theme.
精彩评论