Hello congratulation for your work. I'm in drupal 5.8 and custom template. Trying to use this great module.
It is not working even after editing of code in template.php (I think documentation is not too clear for pleople not used with php codes and variables, number of lines to modify should be more clear)

I've edited the template.php and now it looks like:


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);
    }
	
	//page title
	if (module_exists('page_title')) {
    $vars['head_title'] = page_title_page_get_title();
  } 

    return $vars;
  }
  return array();
}

trying the second method mentioned , i've seen that in our template file page-default.tpl.php the TITLE TAG is declared in this way : print $title

Comments

nicholasthompson’s picture

Status: Active » Closed (works as designed)

You've correctly editted the template.php...

The problem is that you're looking at $title. This is the node title.

Check the section of your page.tpl.php (or page-default.tpl.php - never seen this one...?!). In there you should see:

<title><?php print $head_title ?></title>

The Page Title module modifies (via the template.php modification) the $head_title variable (hence the use of that key in the $vars array.

Hope this helps. Please let me know if you're still stuck.

osviweb’s picture

Status: Closed (works as designed) » Fixed

Fine I've done so and it works!

I've added
print $head_title

I guess my page-default.tpl.php exists because we use different templates according to the page content in a custom edited template.

In your readme file please note where you say:

These lines need to be added to the 'page' hook of the _phptemplate_variables
function.

Here I think you should give more info about where and how to paste the 3 lines of code. I've tried few times and got some errors before to catch it.

congratulations for you work and thanks for great support

Osvaldo
SITE:agenzia viaggi TUI

nicholasthompson’s picture

The problem with documenting it to that level is that EVERYONE's template.php is slightly different.

Also - from Drupal 6 onwards there is no need for any modifications to template.php...

Glad its working for you now :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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