function bartik_preprocess_html

Same name in other branches
  1. 9 core/themes/bartik/bartik.theme \bartik_preprocess_html()
  2. 8.9.x core/themes/bartik/bartik.theme \bartik_preprocess_html()

Add body classes if certain regions have content.

File

themes/bartik/template.php, line 6

Code

function bartik_preprocess_html(&$variables) {
    if (!empty($variables['page']['featured'])) {
        $variables['classes_array'][] = 'featured';
    }
    if (!empty($variables['page']['triptych_first']) || !empty($variables['page']['triptych_middle']) || !empty($variables['page']['triptych_last'])) {
        $variables['classes_array'][] = 'triptych';
    }
    if (!empty($variables['page']['footer_firstcolumn']) || !empty($variables['page']['footer_secondcolumn']) || !empty($variables['page']['footer_thirdcolumn']) || !empty($variables['page']['footer_fourthcolumn'])) {
        $variables['classes_array'][] = 'footer-columns';
    }
    // Add conditional stylesheets for IE
    drupal_add_css(path_to_theme() . '/css/ie.css', array(
        'group' => CSS_THEME,
        'browsers' => array(
            'IE' => 'lte IE 7',
            '!IE' => FALSE,
        ),
        'preprocess' => FALSE,
    ));
    drupal_add_css(path_to_theme() . '/css/ie6.css', array(
        'group' => CSS_THEME,
        'browsers' => array(
            'IE' => 'IE 6',
            '!IE' => FALSE,
        ),
        'preprocess' => FALSE,
    ));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.