Posted By

aleprieto on 02/22/10


Tagged

drupal


Versions (?)

Displaying terms by facet (vocabulary)


 / Published in: PHP
 

URL: http://urlgreyhot.com/personal/weblog/drupal_tip_5_displaying_terms_by_facet_vocabulary

  1. <?php if ($terms): ?>
  2. <?php /* sort taxonomy links by vocabulary 27 */
  3. $terms27 = taxonomy_node_get_terms_by_vocabulary($node->nid, 27);
  4. if ($terms27) {
  5. print '<div class="terms">Forums: ';
  6. foreach ($terms27 as $key => $term27) {
  7. $lterm27 = l($term27->name, 'taxonomy/term/'.$term27->tid);
  8. print $lterm27.' - ';
  9. }
  10. print '</div>';
  11. }
  12. ?>
  13. <?php endif; ?>

Report this snippet  

You need to login to post a comment.