"Done! Now it works AND looks good" - Mads
"Just like the EchoDitto Dev team." - Dan
CSS Aggregation Problems in Drupal 5
This may be old hat to some of you, but it was a near-revelation to me (and tough to find through Googling) so I thought I'd share it and potentially save others some hair pulling.
If your Drupal 5 site goes crazy when you turn on CSS aggregation, try examining your stylesheet(s) for absolutely-addressed url()s. There was (and is) a bug in Drupal 5's CSS aggregator code — since aggregated CSS has to live in a different directory from the original stylesheets, all those URLs have to be rewritten. The function that rewrites them expects them all to be relative, though. So:
background-image: url(/sites/all/themes/zen/xxx/images/something.gif);
gets turned into:
background-image: url(/sites/all/themes/zen/xxx//sites/all/themes/zen/xxx/images/something.gif);
That's obviously no good. Instead, simply make sure that your URLs are all relatively-addressed:
background-image: url(./images/something.gif);
That should be rewritten properly by the aggregator.
The more complete solution, of course, is to fix drupal_build_css_cache(). There is a patch available, but since the issue has been more thoroughly addressed in Drupal 6 and 7, not much attention is being paid to fixing it in 5. And that's probably okay: in most cases it's going to be quicker and easier to simply edit your stylesheet to use relative paths. It's best to avoid patching core when possible, and this is no exception.



Comments
Good afternoon. Everyone wants to be Cary Grant. Even I want to be Cary Grant. Help me! Can not find sites on the: Caduet, pfizer was using sobre for the conducted uses.. I found only this - [URL=http://www.comune.pompiano.brescia.it/Members/Caduet/what-is-caduet-tabs]what is caduet tabs[/URL]. Caduet, but: from the tinnitus of pharmacokinetics online eligible songs smoke only take to view. Thanks :eek:. Victoria from Ireland.
nice post. i have been researching drupal,and this is the first post that had anything negative to say.hmm now i don't no what t do again...joomla or drupal?? or just stick with wordpress to help my business
Post new comment