diff --git a/sites/all/themes/unl_wdn/html.tpl.php b/sites/all/themes/unl_wdn/html.tpl.php index 15efb0910e661165e6bbf42c51262423e2c7cd84..1a28e222d38a07a2b50c75d095cd76edda33c3fd 100644 --- a/sites/all/themes/unl_wdn/html.tpl.php +++ b/sites/all/themes/unl_wdn/html.tpl.php @@ -46,7 +46,7 @@ if (theme_get_setting('use_base')) { $t->head .= '<base href="' . url('<front>', array('absolute' => TRUE)) . '" />' . PHP_EOL; } -$t->doctitle = '<title>'. unl_wdn_head_title() .'</title>'; +$t->doctitle = '<title>'.$head_title.'</title>'; $html = $t->toHtml(); diff --git a/sites/all/themes/unl_wdn/template.php b/sites/all/themes/unl_wdn/template.php index 20d70640d8b2879e3910dc3a9085d8d96cad3b4a..3050ac3609e361bc47de28daaecd57adbbab8b99 100644 --- a/sites/all/themes/unl_wdn/template.php +++ b/sites/all/themes/unl_wdn/template.php @@ -1,5 +1,29 @@ <?php +function unl_wdn_preprocess_html(&$vars, $hook) +{ + /** + * Change the <title> tag to UNL format: UNL | Department | Section | Page + */ + $head_title[] = 'Home'; + + $trail = menu_get_active_trail(); + + foreach ($trail as $item) { + if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) { + $head_title[] = $item['title']; + } + } + + // Change 'Home' to be $site_name + array_unshift($head_title, str_replace( 'Home', variable_get('site_name', 'Department'), array_shift($head_title))); + + //Prepend UNL + array_unshift($head_title, 'UNL'); + + $vars['head_title'] = implode(' | ', $head_title); +} + function unl_wdn_get_instance() { static $instance;