Download & Extend

Custom Page Title for Combination of Taxonomy Terms

Project:Page Title
Version:6.x-2.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi,

The Page Title allows the option to define patterns for individual vocabulary pages like http://example.com/taxonomy/term/1.
But there is not option to define a pattern for a combination of 2 different vocabularies, like http://example.com/taxonomy/term/1,2

The default behavior is that the [term-name] separated by commas is shown as the page title. Is there a way I can define Page Title pattern for a combination of vocabulary?

Example:
Vocabulary 1: Country, Page Title Pattern: Welcome to the country of [term-name]
Vocabulary 2: Sports , Page Title Pattern: List of Posts related to [term-name]

Combination of Vocabulary:
Default Page title behavior: [Country], [Sports]
Possible Pattern for human readability: [Sports] played in [Country]

Is there a way to achieve the above?

Thanks,
Mrigank.

Comments

#1

Version:6.x-2.3» 6.x-2.x-dev

This is quite complicated as the system only supports single terms. As you pointed out, if two are provided, they fall back to the term name, not the term "page title".

The complication is how to deal with the combinations of vocabularies.

For every vocabulary you add, you add a whole new combination of patterns. Not to mention the order the terms come in the URL. What if, in your case, two sports were provided?

I agree, thought, it would be a fantastic feature - great for SEO (dynamically generated pages providing their own targetted page titles). Currently this is not possible without a custom module which implements both hook_page_title_alter() and hook_page_title_pattern_alter(). The DRUPAL-6--2 branch makes extensive use of these hooks in the modules/*.page_title.inc files.

Going forward, the only options I can think of right now are:
a) Change your tactic and use Views + Arguments (DRUPAL-6--2 branch "supports" (WIP) Views and different page titles for different arguments... maybe taxonomy/term/[term-from-sport]/[term-from-country]?
b) Completely redesign the UI to have a more dynamic interface, such as the Rules Admin UI?

#2

This would be a really neat feature +1

I'm using hook_taxonomy_term_page to override the taxonomy/term output with a custom view (this could be the taxonomy/term emulated view). Using this approach would it be possible to generate the page titles dynamically using the views + arguments approach?

#3