I'm using a view to override my taxonomy term pages to display content fields. One of those fields is another taxonomy term (applicable divisons). Displaying the titles of terms applied to the content is no problem (multiple field settings).
The problem comes in here. I need to display icons that represent each of those terms that is an image field in the term itself (division icon). I added a relationship to the view (Content:Taxonomy Terms on node). I can then add the field, but it limits it to one of the terms/icons and it doesn't have a "multiple field settings" area.
I've searched for this quite a while and it's probably an obvious answer, but it's one I can't find or figure out.
Answer: This isn't pretty, but it's getting me the data I want. It needs to be cleaned up. Thanks for the help!
<?php
foreach($data->field_field_applicable_divisions as $mydata) {
if (isset($mydata['raw']['tid'])) {
$term = taxonomy_term_load($mydata['raw']['tid']);
echo "<div class='term_icon'>";
echo "<img src='" . image_style_url( 'icon', $term->field_division_icon['und'][0]['uri']) . "' title='" . $term->field_division_icon['und'][0]['field_file_image_alt_text']['und'][0]['value'] . "' alt='" . $term->field_division_icon['und'][0]['field_file_image_alt_text']['und'][0]['value'] . "'class='term-image' />";
echo "</div> ";
}
}
?>
Also, to get a legend in the header or footer:
<?php
foreach(taxonomy_get_tree(7) as $icon) {
$term = taxonomy_term_load($icon->tid);
echo "<div class='term_icon'>";
echo "<img src='" . image_style_url( 'icon', $term->field_division_icon['und'][0]['uri']) . "' title='" . $term->field_division_icon['und'][0]['field_file_image_alt_text']['und'][0]['value'] . "' alt='" . $term->field_division_icon['und'][0]['field_file_image_alt_text']['und'][0]['value'] . "'class='term-image' /> - " . $term->field_division_icon['und'][0]['field_file_image_alt_text']['und'][0]['value'];
echo "</div> ";
}
?>