You are here

function _phptemplate_variables in Taxonomy Title 5

Override or insert PHPTemplate variables into the templates.

File

./template.php, line 6

Code

function _phptemplate_variables($hook, $vars) {
  switch ($hook) {
    case 'page':

      // for TAXONOMY TITLE
      if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)) && arg(2) > 0) {

        // taxonomy term page - check for custom page title
        $title = _taxonomy_title_get_title(arg(2));
        if ($title != '') {

          // sets the meta title
          drupal_set_title($title);

          // assures the heading is also set
          $vars['title'] = $title;
        }
      }

      // for TAXONOMY TITLE
      break;
  }
  return $vars;
}