Hi, all.
I'd like to change the way teasers look when you view each taxonomy term. Is this possible? Specifically, I'd like to get rid of the term underneath the node title. I'd like the option to get rid of the teaser text as well, though I haven't decided whether I'm going to do that yet.
Yes, I do have Views installed, but I don't really want to go through the trouble of creating a View for every single taxonomy term. I already have three or four custom vocabularies, some with twelve terms per vocabulary, and setting up a separate view for each seems really wasteful, not to mention time-consuming should I choose to add more terms or vocabularies down the road.
Is there a way to do this from within Drupal's admin system, or would I have to theme a separate node type to do this?
EDIT: I moved this to the Theme forum, since that seems more appropriate.
Comments
Have you tried using
Have you tried using arguments in Views? This could allow you to make one view, and then specify the term by either the name or the ID.
Breadcrumbs
At the moment, the only way to access different taxonomy terms is through the breadcrumbs (using taxonomy_breadcrumb). But this won't work with Views. I could expose the taxonomy terms, but frankly I don't want to (I hate drop-down lists).
Custom Breadcrumbs might work, but it appears that the functionality I need is only in the 2.x version, which is still in Dev phase. I'd rather not install any Dev packages on my live site.
Besides, other than what I asked about, everything works fine.
Any other ideas? Worse comes to worst, I can hide the fields using CSS visibility, but that seems like a cheat somehow.
EDIT: It looks like I should be able to override
theme_taxonomy_term_page()from taxonomy.pages.inc.-Karlheinz
Theme overrides don't work.
Well, that didn't work.
It looks like
theme_taxonomy_term_page()only prints the term description; I could move this around on the page (e.g. print it after the teaser nodes, or omit it altogether), but that's only half the battle.On each term page, the teaser contains the term itself right under the node title. An example node teaser, with the parts in square brackets:
I would like to be able to:
...And I'd like to be able to choose which.
I've looked into the API, but I could not find where to do this. I've also looked through
taxonomy.pages.incandtaxonomy.module, but none of those functions seemed to let me do these things. I also cannot find any template suggestions.theme_taxonomy_term_page()calls a function namedtaxonomy_render_nodes(), but this just recursively callsnode_view()to format its output. It appears that the taxonomy module is inserting its terms directly into$node->content, but I can't figure out how.Help...?
-Karlheinz
No?
Anyone?
To reiterate: I've tried looking in the 6.x theming handbook for template suggestions, but I couldn't find any reference to taxonomy suggestions. Am I just missing something?
-Karlheinz
Contemplate?
Seriously... Nothing?
This seems amazing to me. I've seen loads of sites where there are no taxonomy terms in the teasers.
This would be easy if there was a template file for node teasers, but AFAIK there isn't. Would Contemplate work for this sort of thing?
-Karlheinz
Success!
Okay, I finally found the answer.
The code to display the taxonomy terms is in node.tpl.php. I had no idea that this is the template used to create teasers as well, but apparently it is.
I changed this:
...to this:
Now, it will not show any taxonomy terms if $teaser is true.
The other stuff I'd like to do can be done in a similar manner.
EDIT: I added a comment to the Core templates and suggestions page. I don't know if this merits a new sub-page, but if so, I'll be happy to add one.
-Karlheinz
Thanks!
Was trying to do the same thing. Your code & post helped a lot!