Displaying terms by facet (vocabulary)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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; ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.