patch

Archive of Page Title module with critical bug fixed (654758)

Tags: 

While working on multiple sites I've used a wide range of Drupal modules for the purpose of boosting the site's search engine ranking by way of common SEO practices.  One common requirement for this is to be able to override the browser title, aka "page title" beyond just using the article's title.  Thankfully there happens to be a module (i.e. a plugin) specially for this, the suitably named Page Title.

The Page Title module lets you set up a series of rules to control the title based on different things - the type of content, the vocabulary the keyword/term belongs to, etc, which covers for the vast majority of uses.  For those occasions when you need a little more flexibility there's an option to allow each item to be overridden on an individual basis, so e.g. one node can have some extra words added to the title.  The workflow should then be:

  • If an item-specific title is assigned, use it,
  • Otherwise use the configured rule (dubbed a "pattern"),
  • If no rules match the current situation, just a default.

The problem was that for taxonomy term pages ("category" or "topic" pages in in layman's terms) the overridden title was never loaded, it always used the rules.

After about two hours of poking around and testing different techniques, I put together a patch that should work correctly.  In my albeit limited testing it seems to correctly handle page rules and overrides for both normal content (nodes) and term (taxonomy-term) pages and so should be fine to use.  While I have submitted a patch there are always users who do not know how or are otherwise unable to deal with patch files, so to give others a chance to test this change I'm providing a full download of the module's current latest code with the patch applied.  If you happen to have some time to test it out, please do so and submit any feedback or virtual high-fives to the original issue on drupal.org.

Attachments: 

Subscribe to patch