By jptaranto on
I'm using cck to create some custom nodes, each node has a number of fields and is of course associated with a specific taxonomy term.
To style the cck node correctly i'm using the node-cckname.tpl.php method to create a template for the node.
I have some specific information that is the same for each node of the same taxonomy term. I need to hard code this info into the node-cckname.tpl.php.
The obvious way (to me) would be to use a php if statement to say "if taxonomy term is show:"...
ALAS!!! my php knkowledge is puny, and my Drupal knowledge is only sub-par. If someone could post the seemingly simple code, i'd be very happy!!!
Comments
GOT IT!
With a little more search trawling I found a solution, not sure if it's the best but here goes:
Where $term_id is set to whatever the tid of the term your targeting is.
Thanks for posting your snippet
This helped me get past a problem I was having getting a link to display for a certain taxonomy term.
obviously, the taxonomy term in my case is 75, so I used it like this:
Array of terms
What about array of terms? My PHP is not so good. I hope you understand what I want.
<?php $term_id_tid = 1,2,3,44,66,234; .....