从Drupal6中删除不需要的样式表
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了从Drupal6中删除不需要的样式表相关的知识,希望对你有一定的参考价值。
Put this in the template.php within your template directory./* simple example */
function phptemplate_preprocess_page(&$vars)
{
drupal_add_css(THEMEPATH.'/css/sifr.css','theme');
$css = drupal_add_css();
//unset($css['all']['module']['modules/system/system.css']);
//unset($css['all']['module']['modules/system/defaults.css']);
//unset($css['all']['module']['modules/system/system-menus.css']);
unset($css['all']['module']['modules/user/user.css']); unset($css['all']['module']['modules/taxonomy/taxonomy.css']); unset($css['all']['module']['sites/all/modules/cck/theme/content-module.css']); unset($css['all']['module']['sites/all/modules/logintoboggan/logintoboggan.css']); unset($css['all']['module']['sites/all/modules/ubercart/uc_product/uc_product.css']); unset($css['all']['module']['sites/all/modules/cck/modules/fieldgroup/fieldgroup.css']); unset($css['all']['module']['sites/all/modules/filefield/filefield.css']); unset($css['all']['module']['sites/all/modules/img_assist/img_assist.css']); unset($css['all']['module']['sites/all/modules/link/link.css']); $vars['styles'] = drupal_get_css($css);
}
/* whitelist */
function pbot_preprocess_page(&$v)
{
$css = drupal_add_css();
foreach( $css['all']['module'] as $stylesheet => $val )
{
preg_match('@(devel|date|wysiwyg|tinymce|admin_menu|imce)@',$stylesheet,$matches); if( strpos($stylesheet,'sites/all/modules') !== false && empty($matches) ) {
unset($css['all']['module'][$stylesheet]); }
}
$v['styles'] = drupal_get_css($css);
}
以上是关于从Drupal6中删除不需要的样式表的主要内容,如果未能解决你的问题,请参考以下文章
PHP 从Drupal 6中删除不需要的样式表
Drupal 6 视图 2:PHP 片段
从css样式表反应类样式不起作用
如何修复重叠的片段
如何使用带有样式表和 xsltproc 的 xslt 从 xml 中删除元素?
样式表将自动删除/取消注册 - WordPress