Created
June 2, 2016 12:34
-
-
Save klickreflex/da960aa494641693a2f501a58ae5ef67 to your computer and use it in GitHub Desktop.
Drupal: Add Body Class when Tabs are displayed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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