Needs work
Project:
Page Title
Version:
6.x-2.3
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2009 at 22:04 UTC
Updated:
12 Dec 2011 at 01:54 UTC
Jump to comment: Most recent file
Comments
Comment #1
damienmckennaAm having the same problem.
Comment #2
damienmckennaLooking at what's going on in the code, I don't see it even trying to load the overridden value for terms (or anything else for that matter) in page_title_page_get_title(). I'll see if I can come up with a patch to fix it.
Comment #3
damienmckennaChanging the priority to Critical as this key functionality does not work in 6.x-2.3.
Here's a patch that makes the following changes to page_title_page_get_title():
Also:
This has allowed the page title to work as intended: if a page title is manually overridden load it first, otherwise use the pattern structure.
Comment #4
damienmckennaIn the interests of making it easier for beginners, I've bundled the latest code from the v6.x-2.x branch together with my patch: http://www.mc-kenna.com/drupal/2010/01/archive-of-page-title-module-with...
Comment #5
damienmckennaFYI this also rolls in the fix from #654672: Invalid title on forum root.
Comment #6
damienmckennaLooking at the code again, should the manually configured titles also be processed for tokens? Is there a reason why I can't set the title for a node to "something | [site-name]" and expect it to process the token?
Comment #7
damienmckennaI've added a new ticket for processing manually-assigned titles: #689620: Pattern for processing manually-assigned page titles
Comment #8
damienmckennaAn "undocumented feature" in Panels and a page_title misconfiguration was causing this for me.
Comment #9
damienmckennaTo clarify:
Comment #10
jenlamptonI'd like the field on the taxonomy term page to provide the token substitution for [page-title], but I want my $head_title to print out [page-title] | [site-name] (just like we can do with nodes).
I'm not sure this is possible with the current patch, though I may be mistaken.
I've set my default pattern to be: [page-title] | [site-name].
I've entered in my custom page title text on the term's edit form.
And my resulting page title is only [page-title].
The " | [site-name]" part is missing.
I think the behavior should be the same for nodes and terms, but I'm not really sure how to get there.
Comment #11
techgirlgeek commentedFWIW, we ended up writing our own token. If the pattern is set, and the "show field" is checked, it will use the custom page_title if set, otherwise it will use the set pattern.
Here's an example of the token we setup:
hook_token_list().
*/
function mymod_token_list($type = 'all') {
$tokens = array();
if ($type == 'taxonomy' || $type == 'all') {
if (module_exists('page_title')) {
$tokens['taxonomy']['mymod-page_title'] = t("Page title because ignores defaults.");
}
}
return $tokens;
}
/**
* Implementation of hook_token_values().
*/
function mymod_token_values($type, $object = NULL) {
$values = array();
if ($type == 'taxonomy') {
if (module_exists('page_title')) {
$term_title = page_title_load_title($object->tid, 'term');
$values['mymod-page_title'] = !empty($term_title) ? $term_title : $object->name;
}
}
return $values;
}
Comment #12
chefarov commentedNeither of the 2 approaches work for me.
Firstly I tried from project's page the 6-dev version, then I tried the code from McKenna's site.
Finally I tried added the techgirlgeek's code in my page_title.module file which gave me a WSOD.
Comment #13
jenlampton@chefarov the code from @techgirlgeek was missing some comment markers at the beginning. Did you catch that? Try this: