Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function toolbar_preprocess_html

Same name and namespace in other branches
  1. 10 core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
  2. 9 core/modules/toolbar/toolbar.module \toolbar_preprocess_html()
  3. 8.9.x core/modules/toolbar/toolbar.module \toolbar_preprocess_html()

Implements hook_preprocess_html().

Add some page classes, so global page theming can adjust to the toolbar.

File

modules/toolbar/toolbar.module, line 148

Code

function toolbar_preprocess_html (&$vars) {
 if (isset($vars['page']['page_top']['toolbar']) && user_access ('access toolbar')) {
 $vars['classes_array'][] = 'toolbar';
 if (!_toolbar_is_collapsed ()) {
 $vars['classes_array'][] = 'toolbar-drawer';
 }
 }
}

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