Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The ordinary Taxonomy: All Terms field prints a complete list of the node's terms, limited by the vocabulary of my choice. That's just what I need, but I only want to print it if the node is of the right type.
With other fields, I've had great success doing this:
<?php if($data->node_type == my_custom_content_type): {
print $data->node_title;
} endif ?>
Trouble is, the All Terms field isn't in the $data variable. Is there some kind of relationship I can create to put it there?
Or maybe term_data_name could be used instead, but I don't understand why that only prints one of the node's many terms.
Comments
Comment #1
jorge CreditAttribution: jorge commentedSubscribe. I am having loads of trouble access the TIDs for a node from this field. Any help would be great.
Comment #2
jennycita CreditAttribution: jennycita commentedLikewise.
Comment #3
fletch11 CreditAttribution: fletch11 commentedme three
Comment #4
blauerberg CreditAttribution: blauerberg commentedsubscribe.