You are here

public function TaxonomyDisplayTermDisplayHandlerCore::displayTerm in Taxonomy display 7

Build our output to be rendered to the user.

Overrides TaxonomyDisplayTermDisplayHandler::displayTerm

See also

TaxonomyDisplayTermDisplayHandler::displayTerm()

File

handlers/term/core.inc, line 12

Class

TaxonomyDisplayTermDisplayHandlerCore
Add a display handler that will use the Drupal core method of display.

Code

public function displayTerm($term, $options = NULL) {
  $build = array();
  $build = array(
    '#prefix' => '<div class="term-listing-heading">',
    '#suffix' => '</div>',
    'term' => taxonomy_term_view($term, 'full'),
  );

  // We unset $build description key if the Drupal version is less than 7.2
  // and description is empty because the taxonomy_term_view() generation was
  // fixed to not include description, when empty, at that point. Done for
  // compatibility for sites using less than version 7.2.
  if (empty($term->description) && version_compare('7.2', VERSION) == 1) {
    unset($build['description']);
  }
  return $build;
}