By johnhanley on
Is there a way to suppress the multiple taxonomy terms that appear in the page title?
For example: taxonomy/term/10+16+17+18+19+20+21+22+23+24
The title appears as "Title 1, Title 2, Title 3, Title 4, Title 5, Title 6, Title 7, Title 8, Title 9, Title 10"
I'd like to either define a single custom title for the group or just use term 10's title.
Comments
URL Alias
Use a URL Alias (path or pautauto modules)
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
term names
I'm already using URL Alias to set a path for the taxonomy terms.
Drupal insists on displaying ALL the term names associated with the URL Alias. I need a way to suppress this behavior and use only one term for the title.
Then
You'll probably need a small module that uses hook_nodeapi and/or hook_link_alter to change the display.
Edit: Try
drupal_set_titleNancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Another solution (possibly not the most correct)
I use a function in my template.php file to create customized titles out of multiple fields for custom content types (i.e - first name + last name for a person node). You might be able to apply something like this to your situation. I haven't tested the following code, but it's just an idea:
--------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
problem solved
jastraat, thanks for your suggestion. It definitely clued me in on where to go and what to do.
However instead of drupal_set_title() perhaps a better way is to change the title variable value. For example:
Note that if you're using an existing theme like Garland (versus a custom one) you'll want to most like modified the existing _phptemplate_variables function.
Many thanks.
Glad it worked out!
-------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
wait... there's more!
BacteriaMan - your solution is brilliant!
Something I've added to your if() adds on the vocab name too... if that helps others needing the same
using $term from your code....
Finding this post was a big help, thanks so much!
another related solution
jefftrnr,
I'm happy you found this thread helpful.
Speaking of taxonomy, I remember another problem with the same project was displaying taxonomy breadcrumbs properly. I found the Taxonomy Breadcrumb module extremely useful.
Take care,
John
I am not sure where this
I am not sure where this snippet described above would go, so I just experimented and placed it as a standalone in the template.php file. I also did a version with the function named fusion_core_phptemplate_variables....
Of course just cutting and pasting as noobs tend to do gets the predictible result of a broken site :-) I'd appreciate help knowing where in template.php the function goes. Also, if it would be better placed within another function (for example between the first IF and the RETURN statement of this function placed in a page preprocessing function.
I'm putting it in Fusion Core so it will work for Acquia marina and Acquia Prosper.
Just happened to stumble
Just happened to stumble across this thread. It's a bit old, but maybe someone can help me out. I am trying to use an url like http://mysite.com/?q=taxonomy/term/123+567. Individually, the terms do exist, i.e. both terms are attached to some nodes. But when I write them combined with "+", as the Handbook says I'm allowed to do, and as this thread also deals with, I get a page title with both terms (the words, not the id's) combined with "+", but for the rest my page is blank, i.e. no nodes show up. Any idea what I could be doing wrong??
I found...
...that the changed this to:
http://mysite.com/?q=taxonomy/term/123 567Anyway.. I think it is too bad that this is the only solution to this problem.
Since
... i made the mistake to digg this up (confused the year), here is my solution for drupal 6:
insert into template.php
Not working?
Hi, Niels
I tried this code in my template.php file (remembering to change "THEMENAME" to the theme name), but it is still showing all of the terms rather than just one. Does this still work in 6.16?
Thanks
Clear cache
Nevermind. It seems to work now that the website and my browser cache has cleared.
Thanks!
Thanks for the heads-up :-)
Thanks for the heads-up :-)
Location of Template.php
Just a reminder that the template.php page for Fusion templates is in the Fusion Core template. If you can't find a template.php in a subtheme, check in the parent theme's folder. Sounds like common sense but these things do escape noobs like myself.
Breaks FF and Chrome Style Sheets in Fusion themes
There's no reason I can figure, but this breaks the styles for FF and Chrome using Fusion themes.
It sometimes breaks IE8 as well. Causes the right sidebar to disappear and the content to be under the left sidebar. I placed it in the page preprocessing function of the Fusion Core template.php (everything from the beginning if statement through the end where it says to comment out if you do not want the title removed).
Also changed the $variables variable to $vars to match the naming in the current template.php.
Using 6.19 drupal and Fusion 3.0/Acquia_Marina with Skinr 1.5.