You are here

function bartik_preprocess_page_title in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/themes/bartik/bartik.theme \bartik_preprocess_page_title()

Implements hook_preprocess_HOOK() for page templates.

File

core/themes/bartik/bartik.theme, line 41
Functions to support theming in the Bartik theme.

Code

function bartik_preprocess_page_title(&$variables) {

  // Since the title and the shortcut link are both block level elements,
  // positioning them next to each other is much simpler with a wrapper div.
  if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {

    // Add a wrapper div using the title_prefix and title_suffix render
    // elements.
    $variables['title_prefix']['shortcut_wrapper'] = array(
      '#markup' => '<div class="shortcut-wrapper clearfix">',
      '#weight' => 100,
    );
    $variables['title_suffix']['shortcut_wrapper'] = array(
      '#markup' => '</div>',
      '#weight' => -99,
    );

    // Make sure the shortcut link is the first item in title_suffix.
    $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
  }
}