Skip to content

Instantly share code, notes, and snippets.

@klickreflex
Created June 2, 2016 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klickreflex/da960aa494641693a2f501a58ae5ef67 to your computer and use it in GitHub Desktop.
Save klickreflex/da960aa494641693a2f501a58ae5ef67 to your computer and use it in GitHub Desktop.
Drupal: Add Body Class when Tabs are displayed
<?php
function THEMENAME_preprocess_html(&$vars, $hook) {
// Make tabs available on html tpl
$vars['tabs'] = menu_local_tabs();
// if we have primary tabs, add an accoring body class
if (!empty($vars['tabs']['#primary'])) {
$vars['classes_array'][] = 'has-tabs';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment