Troy Thompson

Web Developer

Archive for the ‘drupal’ Tag

  1. Remove Unwanted Drupal Module JS and CSS

    Published
    Last Updated
    Sep 28 2008
    Tagged
    Content

    You need to edit the template.php in your drupal theme.

    Add the following.

    function _phptemplate_variables($hook, $vars = array() )
    {
    	$css = drupal_add_css();
    	unset($css['all']['module']);
    	unset($css['all']['module'][drupal_get_path('module','cck').'/date.css']);//xtra example
    	unset($css['all']['module'][drupal_get_path('module','cck').'/fieldgroup.css']);//xtra example
    	$css['all']['module']['modules/thickbox/thickbox.css'] = 1;
    	$vars['styles'] = drupal_get_css($css);
    
    	$js = drupal_add_js();
    	unset($js['module']['modules/thickbox/thickbox.js']);
    	$vars['scripts'] = drupal_get_js('header', $js);	
    
    	return $vars;
    }