I can't for the life of me get this very important module working. The Drupal 5 documentation says I need to have this code in my template.php theme file:

<?php
function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if ($hook == 'page') {

    // These are the only important lines
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }

  }
  return $vars;
}
?>

Mine, though, has this currently:

<?php
function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'page':
      global $user;
      if ($vars['is_front']) {
        $vars['template_file'] = 'page-index';
      }
      break;
  }

  return $vars;
}
?>

Any variation I try to include the code for this module breaks things. How can I get this working correctly?

Comments

nicholasthompson’s picture

Convert it to

function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'page':
      global $user;
      if ($vars['is_front']) {
        $vars['template_file'] = 'page-index';
      }
      // These are the only important lines
      if (module_exists('page_title')) {
        $vars['head_title'] = page_title_page_get_title();
     }
      break;
  }

  return $vars;
}

Also, on a side note... You dont need that page-index page template line. All frontpage requests naturally look for a file called page-front.tpl.php. See the end of this function... phptemplate_page

Its one of the page suggestions for frontpage only.

nicholasthompson’s picture

Status: Active » Fixed

Marking as fixed - no reply for almost a month.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.