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.
How to get taxonomy term to show under each image, which is already defined in each Album. I no need to add the same taxonomy under each picture.
I added some code in tpl file but it give me not what I need
<?php print $content; ?>
<div class="node node-type-node-gallery-gallery">
<div class="field field-type-text field-field-author-name">
<? // print_r ($node->taxonomy);
//foreach ($node->taxonomy as $term)
// {
// print $term->name . " ";
// }
?>
<div class="field-label">
<div class="field-items">
<div class="field-item odd">
<? // print_r ($node->taxonomy);
//foreach ($node->taxonomy as $term)
// {
// print $term->name . " ";
// }
?> </div>
Comments
Comment #1
scroogie CreditAttribution: scroogie commentedThat could would only work if the image itself would be added to the taxonomy.
If you want to use the taxonomy of the gallery, you will have to retrieve the gallery node first:
Then you can use
or whatever you want to do.
Comment #2
justintime CreditAttribution: justintime commentedOr you could use Node Gallery Taxonomy to keep things in sync between the gallery and the image.
Comment #3
zengenuity CreditAttribution: zengenuity commentedCorrect link to Node Gallery Taxonomy.
Comment #4
zengenuity CreditAttribution: zengenuity commented