CSS Agregation bug

Events happening in the community are now at Drupal community events on www.drupal.org.
crosenblum's picture

I have been testing turning css aggregation on/off, i am using drupal 6.5 with a modified version of aboutpeople theme.

In either case, it looks fine in firefox.

But in ie, with css caching enabled, can not find the aggregated css file.

I think it would be nice to know exactly how css aggregation works, and maybe instead of a different file name each time, it creates one file that it updates, or deletes depending on css aggregation being on.

Comments

Hi CSS Aggregation works

bennos's picture

Hi

CSS Aggregation works almost with compressing the files like cleaning out white spaces (just like a zip programm).

To reduce the count of request CSS Files can be combinend.
This can break your theming if you have not followed good coding guide lines. No namespace overlapping!.

The integrated CSS Aggregator in Drupal updates almost on Cron Run.

If you don't like the integrated solution, you can use other modules. I use in D5 the support file cache module.

I made my own fix for this bug.

crosenblum's picture
  1. I enabled css compression
  2. Then i looked in my source code for the new css aggregated file, then i made a copy of that into my theme folder as compressed.css
  3. Then i went to my page.tpl.php
  4. Grabbed the filename from $styles
  5. Checked if it existed, if so, behave like normal
  6. However if it did not exist, to use my compressed one.

Here's my code..

<?php
  
// step 1 grab file name
  
$filename = str_replace('<link type="text/css" rel="stylesheet" media="all" href="','',$styles);
$filename = str_replace('" />','',$filename);
 
// step 2 check if file exists
if (file_exists($filename)) {
      print
$styles;
} else {
       print
'<link type="text/css" rel="stylesheet" media="all" href="/themes/aboutpeople/compressed.css" />';
   }
?>

Now this is really a short term fix, because still no idea why ie7 can't find css aggregated css files.

Which is actually an important concern.

Any ideas anyone?

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: