Though Framework was the first choice of them for my website, I had to lose it because I was unable to use the Page Title module (http://drupal.org/project/page_title) to create custom page titles for nodes.

To do this I have to add a certain code in template.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;
} 

When I attempt this with the Framework theme, my drupal site crashes. Could anyone please guide me how to use it. Here are the installation instructions for page_title module - http://drupal.org/node/254765

Comments

andregriffin’s picture

Status: Active » Fixed

This is a super easy fix. If you'll notice in the instructions, "These lines need to be added to the 'page' hook of the _phptemplate_variables function."

The code in template.php you need to change looks like this

/**
 * Override or insert PHPTemplate variables into the templates.
 */
function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {

    if ($secondary = menu_secondary_local_tasks()) {
      $output = '<span class="clear"></span>';
      $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
      $vars['tabs2'] = $output;
    }

    // Hook into color.module
    if (module_exists('color')) {
      _color_page_alter($vars);
    }
    return $vars;
  }
  return array();
}

It needs to be altered like so:

/**
 * Override or insert PHPTemplate variables into the templates.
 */
function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {

    if ($secondary = menu_secondary_local_tasks()) {
      $output = '<span class="clear"></span>';
      $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
      $vars['tabs2'] = $output;
    }

    // Hook into color.module
    if (module_exists('color')) {
      _color_page_alter($vars);
    }
		
    // Hook into page_title.module
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }
    return $vars;
  }
  return array();
}
andregriffin’s picture

This modification has been included in Framework 5.x-2.2

deadlyminds’s picture

Thanks Andre. Appreciate i. I've downloaded the latest version of Framework. Another dumb question - Do i still need to add the code in the 2.2 version?

andregriffin’s picture

I've added the code into 5.x-2.2. You no longer need to add it. For Drupal 6, it is my understanding that the module does not require this modification.

deadlyminds’s picture

Thanks. It's working now!

Status: Fixed » Closed (fixed)

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