By Duplika on
I'm trying to find a way to customize the way terms are printed at my garland theme, based on what term the node belongs to.
Right now, every node has the term name and a link to it posted at the very bottom of it because of the <?php print $terms; ?> code at the node.tpl.php file. I'd like to add something else depending on the term that the node belongs to, doing something like this:
<?php if ($term == 4): ?>Hello Earth<?php endif; ?><?php if ($term == 2): ?>Hello Marte<?php endif; ?><?php if ($term == 1): ?>Hello Venus<?php endif; ?><?php print $terms; ?>
Making "Hello World" appear when the node belongs to a certain term ID (2, 3 or any). Of course this doesn't work.
Does anyone have any clue on how to make this work?
Comments
Hi
Hi,
Don't try like this way.Just try to do that using the term id or vocabulary id..that's all.
If you are using that way means ,how it's identify the terms.
The terms are identified using the id.
Thanks,
Raj.
Isn't that way I'm doing?
Isn't that way I'm doing? I've also tried using
<?php if ($term->tid == 1): ?>dk<?php endif; ?>but still no luck.