Created
September 23, 2013 12:10
-
-
Save vdchristelle/6669607 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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//change node title to commercial title on taxonomy pages | |
if (isset($variables['page']['content']['system_main']['term_heading']['term']['#term']->tid)) { | |
$term_info = taxonomy_term_load($variables['page']['content']['system_main']['term_heading']['term']['#term']->tid); | |
if (isset($term_info) && !empty($term_info)){ | |
$variables['h1_title'] = $term_info->the_aim_seo_pagetitle['und'][0]['value']; | |
} | |
} | |
//optie 2 | |
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