7.x theme.inc template_process_page(&$variables)

Process variables for page.tpl.php

Perform final addition of variables before passing them into the template. To customize these variables, simply set them in an earlier step.

See also




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


function template_process_page(&$variables) {
  if (!isset($variables['breadcrumb'])) {

    // Build the breadcrumb last, so as to increase the chance of being able to
    // re-use the cache of an already rendered menu containing the active link
    // for the current page.
    // @see menu_tree_page_data()
    $variables['breadcrumb'] = theme('breadcrumb', array(
      'breadcrumb' => drupal_get_breadcrumb(),
  if (!isset($variables['title'])) {
    $variables['title'] = drupal_get_title();

  // Generate messages last in order to capture as many as possible for the
  // current page.
  if (!isset($variables['messages'])) {
    $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : '';