Unnecessary files (css files) are being loaded..
errorist - June 11, 2009 - 05:35
How can I prevent unnecessary files to be loaded. e.g. in my classifieds module I can see css files loaded that are residing in events module.???
The css files that are only for event module should not load with other modules. Its making my website very slow.

Drupal is database driven.
Drupal is database driven. Trust me, it is the database server that makes your site slow, not the serving of static files (i.e., css).
That being said, you have several options.
-Corey
- Corey
and if i want to do this
and if i want to do this handcoded - not with a module?
and i first want to remove 90% of all modules css files and then use the compression ...
is there stuff i can do in the xxx.info or template.php file?
thanks momper
There's a several different
There's a several different ways that css files can be added, but hacking the .info or module files is bad practice.
You could use your custom theme to filter the css files included, either by adding a preprocess function or by explicitly including files in your page template.
I would still use the module route.
-Corey
- Corey
in template.php for
in template.php for example
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars) {
// Unset stylesheets.
$css = $vars['css'];
unset($css['all']['module']['modules/node/node.css']);
unset($css['all']['module']['sites/all/modules/users/logintoboggan/logintoboggan.css']);
unset($css['all']['module']['sites/all/modules/voting/fivestar/css/fivestar.css']);
unset($css['all']['module']['sites/default/files/fivestar/basic/basic.css']);
unset($css['all']['module']['sites/all/modules/views/views_cloud/views_cloud.css']);
unset($css['all']['module']['sites/all/modules/js/jcarousel/jcarousel.css']);
unset($css['all']['module']['sites/all/modules/js/jcarousel/jcarousel/lib/jquery.jcarousel.css']);
unset($css['all']['module']['sites/all/modules/views/flag/theme/flag.css']);
unset($css['all']['theme']['themes/kiezblogs/_css/jcarousel/skin.css']);
$vars['styles'] = drupal_get_css($css);
}