By modul on
Hi all,
I have Views taking care of my taxonomy/term/tid pages (in Drupal 5.6). Generally speaking, it's doing fine. One thing, though: I can't get hold of the Page Title in the resulting pages. Can anyone tell me where, in which .tpl or in which 'environment', I can grab that title and perform some theming on it?
- I am looking for ways to influence the title in general.
- And if possible, but that's of lesser importance right now, I'm also looking for ways to influence the title depending on which term is being displayed.
Any hints?
Thanks!
Comments
Some progress... When you go
Some progress... When you go to administer Views for the "taxonomy_term" view, look for the Arguments section. There, "Argument Type" >> Taxonomy Term ID, you can fill in "%1" in the "Title" field. This will take the value of your tid (i.e. the term itself, not the number), and it will be used as your page title. You can, however, surround this %1 with divs, giving you at least some ways to beautify it a little bit. For instance,
<div class="someclass">%1</div>will work.This is not yet the final target, because it doesn't work with conditions. It would be nice to have something like
Could this, perhaps, be done in the "Argument handling code"?? I have the feeling a lot could be done in that part of Views, but I don't get to see many working examples.
Answering your own questions
Answering your own questions may not be the actual purpose of this forum, but if you dislike unanswered questions as much as I do, here's at least part of the solution to my problem, i.e. how to theme the page title on /taxonomy/term/tid pages. It can indeed be done with the Argument Handling code. Here's a fictitious example, applying a special style and modification to the page title in case the tid is 82.
Mind: there's no error checking, no cleansing of arg(2) etc., this is just the barebones thing. Argument handling php is bit hard to code because you can't echo test stuff (how I missed my var_dump) - at least I can't. And it won't work in case your View outputs stuff to a block (because of the unavailability of arg(2), but at least this part of the puzzle is solved. Yééééé.
Custom page title for taxonomy term pages
You can easily set the page titles for taxonomy term pages on Drupal 6.x using Taxonomy enhancer module. For Drupal 6.x you must use this version: http://drupal.org/node/305736#comment-1058315
1. You need to install this module and add new field named "page_title" to the vocabilary.
2. Add this text to template.php
3. Set the "page_title" text for term.
I just wrote a different
I just wrote a different tutorial on theming taxonomy term pages: Improving navigability of Drupal taxonomy hierarchies
+ David Herron - 7gen.com/, The Long Tail Pipe, davidherron.com/drupal-blogging-hints