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
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
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): ?>
<?phpif ($has_terms) :
?>
<?phpprint $terms
?>
which I substituted with
<?phpif (($submitted or $has_terms) && !$teaser) :
?>
<?phpif (($has_terms) && !$teaser):
?>
<?phpprint $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
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
subscribe