One of the first things you will want to do is to alter the Page Title defaults to test whether your installation process was correct. Navigate to…

  • Drupal 6: Administer › Site configuration > Page title
  • Drupal 7: Administration > Configuration > Search and metadata

…to access the configuration page for this module.

The default (fall-back) title pattern is:

  • Drupal 6: [page-title] | [site-name]
  • Drupal 7: [current-page:page-title] | [site:name]

The frontpage title pattern is:

  • Drupal 6: [site-name] | [site-slogan]
  • Drupal 7: [site:name] | [site:slogan]

If you don't change this, the title will continue to include the site name. If you alter this, you can (if you so desire) remove the site name from the pattern. This is where you get the control of the "pattern" (or template) of the text.

Page Title gives you granular control over the default title (the title pattern used if no specific type matches) and the frontpage title (used for the frontpage only). The module then gets extended for several other "contexts" including:

  • Nodes: one token pattern/template for each node content type (eg, node/123).
  • Vocabularies: one token pattern/template for each vocabulary (eg, taxonomy/term/123).
  • Blogs: a pattern for the users blog home page (eg, blog/123).
  • Users: a pattern for the users profile page (eg, user/123).
  • Forums: a pattern for the forum root (eg, forum). Forum containers, Forums and Topics are controlled using Taxonomy and Node "contexts" above.
  • Comments: a pattern for the comment posting and reply pages (eg, Node reply: comment/reply/123 and Comment Reply: comment/reply/123/456).

This allows you to configure, for example, your blog page titles to be in the form "title by author" and the forum node types to contain the board and thread the post is in, eg "General Chat > Where are you guys from?".

Sometimes, there is a checkbox which enables the administrator to control whether the Page Title field appears on a node, term or user create or edit form. This allows some nodes to 'inherit' the title from the node title and other nodes have the option to override the [page-title] token. This is especially useful for promoting your blog entries to search engines. Usually bloggers write their blog title as something catchy, clever or funny to grab the readers attention. Unfortunately this tagline is not always the phrase searched for - in this case, the author could override the Node Title and provide a separate Page Title which is far more user friendly without sacrificing that funny title they spent hours dreaming up. Note that this field does not allow the admin to completely override the Page Title, but just the [page-title] token, which will be inserted as normal into the Pattern for that node type.

So, basically, if you use the [page-title] (or [current-page:page-title] in D7) token in the patterns/template settings, it will take it's value in the following order:

  1. the value of the Page Title field.
  2. the Entity Title (eg, Node Title, User Name or Term Name), if Page Title field has no value (in 1).
  3. the value of the title returned by Drupal's "get title" system (ie a fallback). This is usually defined by the Menu API system.

Comments

strider72’s picture

I use this on a Real Estate web site. There's a "Building" node type, and on those pages I set the Page Title to "Apartments for Rent at [page-title]". There are a few buildings however that are commercial properties, and for those I want to say "Office Space for Rent at [page-title]".

I enabled the Page Title field on the Edit pages, but if I fill in "Office Space for Rent at (building name)" I don't get that, I get "Apartments for Rent at Office Space for Rent at (building name)".

Perhaps an "override" option could be added on the admin page so that I can check "Show Field" and also choose "Override All" or something so it overrides the entire Page Title pattern rather than just the [page-title] token within the pattern.

Or does anyone know of an existing module that can do this already? This issue is killing this module for me -- it's sooooo close to being completely awesome! :-) Thanks.

gpk’s picture

You would probably need to use CCK to let you define via a simple radio button select whether the building is of type Apartment or Office, and then use that CCK token to provide the additional granularity you want in your Page Titles.

silentway’s picture

If you're seeking use of the "pager" functionality of this module, the token is the very last in the "Available Tokens List". It is:
[page-number]

PROMES’s picture

I took the [page-number] from the comment, but in D6 I get this error:
The Pager Suffix is using the following invalid tokens: [page-number].
In D6 it should be: [current-page-number].

caominh’s picture

Hi,
I just installed this module (6.x-2.3) on my Drupal 6.12 site and have enabled the module and configured it to have the page_title field appear on my target node types. However, although the field now appears on the edit view for these node types (and the page_title table appears in the db), if I type a value into the field and save the changes, it appears that the system fails to save this value and the title from the original title field appears.
Could there be some setting in another module that is overriding the page_title field value, or should I be looking at some other issue.
Thanks!

obironkenobi’s picture

I have the same experience regarding having the custom node-specific page title. The patterns work fine, and I'm able to set a node-specific override for the page title. But ultimately this title does not dispaly.

Anonymous’s picture

I'm having a similar problem - the page title I set in the Edit form doesn't appear on the page. Am I missing a step, or is something wrong with the way the module's functioning?
The patterns are great - thanks!

MJK73’s picture

Patterns work, but individual nodes aren't appearing. I'm using a custom theme based on Garland. It was working in version 6.17, but stopped working when we upgraded to 6.19.

Any insight into this? Anyone? Bueller?

asb’s picture

I'm experiencing a similar issue with a custom-built theme. Since I know that the 'Page Titles' module works correctly with proper base themes (like Fusion) and core themes (like Garland), I was suspecting a theme override or a more general problem with the theme. However, the page.tpl.php looks always like this:

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

So indeed this is a theme override in template.php, where I found this:

  // this is from theme.inc
  // we are changing this so that it strips tags from the $head_title
  if (drupal_get_title()) {
    $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));
  }
  else {
    $head_title = array(variable_get('site_name', 'Drupal'));
    if (variable_get('site_slogan', '')) {
      $head_title[] = strip_tags(variable_get('site_slogan', ''));
    }
  }
  $vars['head_title'] = implode(' | ', $head_title);

I have not the faintest idea what the theme dev tried to accomplish with that.

However, to verify if this problem is theme releated: Could you please check if a theme like 'Garland' does show the changed page titles on your sites?