Skip to content

Instantly share code, notes, and snippets.

@fieke
Created November 4, 2013 09:46
Show Gist options
  • Save fieke/7300337 to your computer and use it in GitHub Desktop.
Save fieke/7300337 to your computer and use it in GitHub Desktop.
Override the value of the h1_title with the commercial title on taxonomy pages (for old sites)
function the_aim_theme_preprocess_page(&$variables, $hook) {
if(arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$variables['h1_title'] = drupal_get_title();
$term_info = taxonomy_term_load($variables['page']['content']['system_main']['cont']['field_overview_image_large']['#object']->tid);
if (isset($term_info) && !empty($term_info)){
$variables['h1_title'] = $term_info->the_aim_seo_pagetitle['und'][0]['safe_value'];
drupal_set_title($variables['h1_title']);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment