Hi, I have a site in which we use the taxonomy/term to display a number of different terms. What I would like to do is set the title to be something a little more meaningful that the list of all the terms that are being included. so a list like "aaa, bbb, ccc" could be changed to "the abc's" which looks a better. So I need a hook that is called after the the print theme('page', $output); and before the drupal_get_title(); so I can set it to something else. Looking through the phptemplate at the page my choices seem quite limited. I noticed the theme('closure') but this is run after the drupal_get_title(). The other option was to create a non-block which will set the title for me, but not actually display any block. This would be a little kludgy but would work, or I could move the setting of the title to lower in the list. Does anyone have any ideas of how I can change the title on the taxonomy/term page to something nicer without having to hack too much of core. Thanks in advance. Gordon.
Does anyone have any ideas of how I can change the title on the taxonomy/term page to something nicer without having to hack too much of core.
You could use a _help hook, or similar, like: function example_help($section) { if ((arg(0) == 'taxonomy') && (arg(1) == 'term)) { $tids = arg(2); $title = [however you want to parse it]; drupal_set_title($title); } } I use a similar workaround in taxonomy_context.module. Some time back I suggested a 'view' op in the _taxonomy hook, http://drupal.org/node/10399. I'd say your question is an example of where this would be useful.
Hi Gordon, If you are using phptemplate you should be able to override titles in a template.php file, as shown here: http://drupal.org/node/16383 HTH, Mark On 12 Dec 2005, at 05:25, Gordon Heydon wrote:
Hi,
I have a site in which we use the taxonomy/term to display a number of different terms. What I would like to do is set the title to be something a little more meaningful that the list of all the terms that are being included. so a list like "aaa, bbb, ccc" could be changed to "the abc's" which looks a better.
So I need a hook that is called after the the print theme('page', $output); and before the drupal_get_title(); so I can set it to something else.
Looking through the phptemplate at the page my choices seem quite limited. I noticed the theme('closure') but this is run after the drupal_get_title(). The other option was to create a non-block which will set the title for me, but not actually display any block. This would be a little kludgy but would work, or I could move the setting of the title to lower in the list.
Does anyone have any ideas of how I can change the title on the taxonomy/term page to something nicer without having to hack too much of core.
Thanks in advance. Gordon.
participants (3)
-
Gordon Heydon -
Mark Leicester -
Nedjo Rogers