You are here

function theme_content_taxonomy_formatter_link in Content Taxonomy 6

Same name and namespace in other branches
  1. 6.2 content_taxonomy.module \theme_content_taxonomy_formatter_link()

Theme function for 'link' text field formatter.

File

./content_taxonomy.module, line 230
Defines a field type for referencing a taxonomy term.

Code

function theme_content_taxonomy_formatter_link($element) {
  if (!empty($element['#item']['value'])) {
    $term = taxonomy_get_term($element['#item']['value']);
    _content_taxonomy_localize_term($term);
    return l($term->name, taxonomy_term_path($term), array(
      'attributes' => array(
        'rel' => 'tag',
        'title' => $term->description,
      ),
    ));
  }
}