function template_process_html

You are here

7 theme.inc template_process_html(&$variables)

Process variables for html.tpl.php

Perform final addition and modification of variables before passing into the template. To customize these variables, call drupal_render() on elements in $variables['page'] during THEME_preprocess_page().

See also

template_preprocess_html()

html.tpl.php

File

includes/theme.inc, line 2625
The theme system, which controls the output of Drupal.

Code

function template_process_html(&$variables) {
  // Render page_top and page_bottom into top level variables.
  $variables['page_top'] = drupal_render($variables['page']['page_top']);
  $variables['page_bottom'] = drupal_render($variables['page']['page_bottom']);
  // Place the rendered HTML for the page body into a top level variable.
  $variables['page'] = $variables['page']['#children'];
  $variables['page_bottom'] .= drupal_get_js('footer');

  $variables['head'] = drupal_get_html_head();
  $variables['css'] = drupal_add_css();
  $variables['styles'] = drupal_get_css();
  $variables['scripts'] = drupal_get_js();
}

Comments

The way this function sets these variables seems to defy the entire point of having a preprocessor function. Many changes you might want to make in template_preprocess_html will be overwritten here in template_process_html.

You can use hook_process() to come after this hook. I sort of think of this hook as hook_preprocess_alter() (which doesn't actually exist), since it comes after all normal preprocessing. Any implementations of hook_preprocess() will come after this function, allowing you to modify any of the variables set here.