是否可以删除module / system / default.css文件。我想在.module文件中而不是在template.php文件中执行此操作。
我的目标是在drupal网站中禁用此样式而不操作模板/主题。
有可能吗?
提前致谢,
蝙蝠
答案 0 :(得分:5)
这是可能的。您可以在自定义模块中使用template_preprocess_page
来敲击Drupal的默认CSS:
function mymodule_preprocess_page(&$vars) {
// Get CSS array and remove selected stylesheets
$css = drupal_add_css();
unset($css['all']['module']['modules/system/defaults.css']);
// Override Drupal styles
$vars['styles'] = drupal_get_css($css);
}
由于Drupal的架构,你几乎肯定需要set the module weight更大的东西比你安装的其他模块更大,以确保你的预处理器运行最后,没有其他模块将添加CSS。