You are here

function panopoly_core_preprocess_page in Panopoly Core 7

Implements hook_preprocess_page().

1 string reference to 'panopoly_core_preprocess_page'
panopoly_core_theme_registry_alter in ./panopoly_core.module
Implements hook_theme_registry_alter().

File

./panopoly_core.module, line 87

Code

function panopoly_core_preprocess_page(&$variables) {

  // The breadcrumbs are rendered in template_process_page(), so this is an
  // opportunity to modify them right before that.
  if (variable_get('panopoly_core_breadcrumb_title', TRUE)) {
    $breadcrumb = drupal_get_breadcrumb();
    if (drupal_is_front_page()) {

      // If it is the homepage, remove the breadcrumb.
      $breadcrumb = array();
    }
    elseif (is_array($breadcrumb) && count($breadcrumb) > 0 && drupal_get_title()) {

      // Set the current page title in the breadcrumb.
      $breadcrumb[] = drupal_get_title();
    }
    drupal_set_breadcrumb($breadcrumb);
  }
}