Hide taxonomy from teaser

david.sarnowski - November 8, 2007 - 08:49

I am looking to hide the taxonomy terms from my teasers. I am fine with them showing up in the node, but they make make my teasers awfully long. I am using the Zen theme.

I know I can hide them by playing with the node.tpl.php file, but that hides them everywhere.

Any ideas?

you're on the right track

CrookedNumber - November 8, 2007 - 20:46

Try this. Find the following line in node.tpl.php

<?php if (count($taxonomy)): ?>

and change it to:

<?php if (count($taxonomy) && !$teaser): ?>

provided you haven't created other .tpl files that override this, it should work.

Same problem

Uppa - April 17, 2009 - 15:26

I had the exact same problem but using the danger4k theme; I couldn't find the line above in my nod.tpl but I found this

?php if ($submitted or $has_terms): ?>

<?php
if ($has_terms) :
?>

<?php
print $terms
?>

which I substituted with

<?php
if (($submitted or $has_terms) && !$teaser) :
?>

<?php
if (($has_terms) && !$teaser):
?>

<?php
print $terms
?>

adding && !$teaser one by one, strating from the last; In Firefox the taxonomy terms disappeared immediatley, in Opera, IE7, Chrome and Safari they didn't...
Why????
Thanks Claudia www.setificio.com

Miraculously

Uppa - April 17, 2009 - 16:11

After fiddling around and getting a (scary) parsing error, I reloaded the old node.tpl. remodified it, republished it and now it works in all browsers!
Claudia

subscribe

basicmagic.net - November 11, 2007 - 13:25

subscribe

 
 

Drupal is a registered trademark of Dries Buytaert.