taxonomy_link

  1. drupal
    1. 4.7
    2. 5 taxonomy.module
    3. 6 taxonomy.module
Versions
4.7 – 6 taxonomy_link($type, $node = NULL)

Implementation of hook_link().

This hook is extended with $type = 'taxonomy terms' to allow themes to print lists of terms associated with a node. Themes can print taxonomy links with:

if (module_exist('taxonomy')) { $this->links(taxonomy_link('taxonomy terms', $node)); }

Code

modules/taxonomy.module, line 27

<?php
function taxonomy_link($type, $node = NULL) {
  if ($type == 'taxonomy terms' && $node != NULL) {
    $links = array();
    if (array_key_exists('taxonomy', $node)) {
      foreach ($node->taxonomy as $term) {
        $links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
      }
    }
    return $links;
  }
}
?>