Closed (fixed)
Project:
CDN
Version:
6.x-2.1
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Feb 2011 at 20:56 UTC
Updated:
20 Mar 2011 at 16:40 UTC
Hello. This is more of a note than anything else. I was running in to an issue where my CSS files were not being served from the CDN. After tracing this back through file_create_url, cdn_file_url_alter, drupal_get_css, and template_preprocess_page, I have what I think may be an important tip.
In the event that you decide to implement a mytheme_preprocess_page() call in template.php, you will also need to re-add this line to your custom preprocess function:
$vars['styles'] = drupal_get_css();
Otherwise, the rewritten CDN paths for CSS files are not used, which means that all of your css files and background images will still be served locally.
Comments
Comment #1
rjbrown99 commentedThis is just an FYI, so I am closing it out.
Comment #2
wim leersVery interesting! Thanks for letting us know — I'm sure this will come in handy to some theme developers some day! :)
Comment #3
rjbrown99 commentedOne more note. If you are using the conditional_styles module, you need to re-pop that into the preprocess_page as well.
Per #690460: Conditional styles not added to $styles?, comment #1.
Comment #5
wim leersNow properly documented: http://drupalcode.org/project/cdn.git/commit/60609b4