I am surprised since everything is pretty straight forward, I am putting [term-raw] | [title-raw] in my content type but the titlle (i.e. ) is still showing only title of the page and NOT adding the term name in it. Any idea ?

Comments

Pushkar Gaikwad’s picture

I am on drupal 5.19, is this a problem ? I don't see why this will be a problem though

iris_support’s picture

Download the module as usual (untar in sites/all/modules)
Enable the module via Drupal (in Administer > Build > Modules)

In drupal 5 version of page_title, it's just not enough if you enable the module, you also need to make few changes in your active theme's template.php.

Check whether there is a function named _phptemplate_variables($hook, $vars) exits in template.php. Function name can be either theme engine name(phptemplate) or theme name (for eg., garland). This function _phptemplate_variables($hook, $vars) is used to overwrite or insert PHPTemplate variables into the template files.

If the function is present then insert the following code in the same.

<?php
if ($hook == 'page') {
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }
?>

If the function _phptemplate_variables($hook, $vars) is not present add the following code

<?php
function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }
 }
    return $vars;
}
?>

So what are we doing here?

Unlike drupal 6, $head_title variable cannot be changed while it's being generated by drupal. So we change the $head_title variable in the tempate.php in drupal 5. This function page_title_page_get_title() present in page_title.module gets the value of the page title according to the pattern you have set.

Hope this helps!

nicholasthompson’s picture

Status: Active » Fixed

Marking as fixed - no reply in over 2 months...

Status: Fixed » Closed (fixed)

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