Drupal - Unset (not include) all core stylesheets - Theme variable overrides.


/ Published in: PHP
Save to your folder(s)

Removes the core, and node styles from the $style variable.

You most morbably already defined _phptemplate_variables($hook, $vars), in that case just add the two lines there.
_sympal_theme.. is the name of the theme where we use this.


Copy this code and paste it in your HTML
  1. function _phptemplate_variables($hook, $vars) {
  2. switch ($hook) {
  3. case 'page':
  4. $vars['css'] = _sympal_theme_unset_css($vars['css']);
  5. $vars['styles'] = drupal_get_css($vars['css']);
  6. break;
  7. }
  8.  
  9. return $vars;
  10. }
  11.  
  12. /**
  13.  * Unset all module and core styles
  14.  **/
  15. function _sympal_theme_unset_css($css) {
  16. if (is_array($css['all']['module'])) {
  17. $css['all']['module'] = array();
  18. }
  19. return $css;
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.