You are here

function tagadelic_tags_lists in Tagadelic 5

Same name and namespace in other branches
  1. 6 tagadelic.module \tagadelic_tags_lists()

API function that returns the tags of a node in fancy titled lists

Parameters

$node. A node object.:

1 call to tagadelic_tags_lists()
tagadelic_block in ./tagadelic.module
implementation of hook_block

File

./tagadelic.module, line 184

Code

function tagadelic_tags_lists($node) {
  if (is_array($node->tags)) {
    foreach ($node->tags as $vid => $terms) {
      $vocabulary = taxonomy_get_vocabulary($vid);
      $title = l($vocabulary->name, "tagadelic/chunk/{$vid}");
      $items = array();
      foreach ($terms as $term) {
        $items[] = l($term->name, taxonomy_term_path($term), array(
          'title' => t('view all posts tagged with "@tag"', array(
            '@tag' => $term->name,
          )),
        ));
      }
      $output .= theme('item_list', $items, $title);
    }
    return $output;
  }
}