How to apply an IE6 specific stylesheet for a subtheme?
SteveJB - July 20, 2008 - 09:09
| Project: | Zen |
| Version: | 5.x-1.1 |
| Component: | IE Problems |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I have the following in my page.tpl.php
<!--[if IE 6]>
<?php if ($subtheme_directory && file_exists($subtheme_directory .'/ie6.css')): ?>
<link rel="stylesheet" href="<?php print $base_path . $subtheme_directory; ?>/ie6.css" type="text/css">
<?php else: ?>
<link rel="stylesheet" href="<?php print $base_path . $directory; ?>/ie6.css" type="text/css">
<?php endif; ?>
<![endif]-->The above code is mostly based on http://drupal.org/user/254346. I have also tried modifying the code to read as
<!--[if IE 6]>
<link rel="stylesheet" href="<?php print $base_path . $directory; ?>/ie6.css" type="text/css">
<?php if ($subtheme_directory && file_exists($subtheme_directory .'/ie6.css')): ?>
<link rel="stylesheet" href="<?php print $base_path . $subtheme_directory; ?>/ie6.css" type="text/css">
<?php endif; ?>
<![endif]-->or
<?php
endif;
?>The above code is mostly based on http://drupal.org/user/254346. I have also tried modifying the code to read as
<!--[if IE 6]>
<link rel="stylesheet" href="<?php print $base_path . $subtheme_directory; ?>/ie6.css" type="text/css">
<![endif]-->There is a custom page.tpl.php file in the Zen subtheme and the ie6.css file exists in the correct sub theme folder yet none of the changes in the stylesheet is applied in ie6. The changes applied to the built in ie.css works fine but if I need to apply a change only to ie6, it just doesn't seem to be working.

#1
Somehow while copy/pasting or uploading there was extra text. Please ignore:
<?phpendif;
?>
The above code is mostly based on http://drupal.org/user/254346. I have also tried modifying the code to read as
#2
Your examples should work (for drupal5), unless you've just happened to reach ie's limit of 31 stylesheets. Are you using a lot of stylesheets, or many modules that have their own stylesheets? If so, search around for solutions being worked on for this, enable CSS aggregation (not good during development) or consolidate some css.
#3
Thanks echoz,
That could be it. I can manually verify there are 29 style sheets in use. That could be why.
#4
seems this was resolved