You are here

function views_handler_field_taxonomy::render_link in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 modules/taxonomy/views_handler_field_taxonomy.inc \views_handler_field_taxonomy::render_link()
  2. 7.3 modules/taxonomy/views_handler_field_taxonomy.inc \views_handler_field_taxonomy::render_link()

Render whatever the data is as a link to the taxonomy.

Data should be made XSS safe prior to calling this function.

1 call to views_handler_field_taxonomy::render_link()
views_handler_field_taxonomy::render in modules/taxonomy/views_handler_field_taxonomy.inc
Render the field.

File

modules/taxonomy/views_handler_field_taxonomy.inc, line 44

Class

views_handler_field_taxonomy
Field handler to provide simple renderer that allows linking to a taxonomy term.

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_taxonomy']) && !empty($values->{$this->aliases['tid']}) && $data !== NULL && $data !== '') {
    $term = new stdClass();
    $term->tid = $values->{$this->aliases['tid']};
    $term->vid = $values->{$this->aliases['vid']};
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = taxonomy_term_path($term);
  }
  return $data;
}