public function TermRenderController::buildContent

Overrides Drupal\Core\Entity\EntityRenderController::buildContent().

Overrides EntityRenderController::buildContent

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php, line 22
Definition of Drupal\taxonomy\TermRenderController.

Class

TermRenderController
Render controller for taxonomy terms.

Namespace

Drupal\taxonomy

Code

public function buildContent(array $entities, array $displays, $view_mode, $langcode = NULL) {
  parent::buildContent($entities, $displays, $view_mode, $langcode);
  foreach ($entities as $entity) {

    // Add the description if enabled.
    $display = $displays[$entity
      ->bundle()];
    if (!empty($entity->description->value) && $display
      ->getComponent('description')) {
      $entity->content['description'] = array(
        '#markup' => check_markup($entity->description->value, $entity->format->value, '', TRUE),
        '#prefix' => '<div class="taxonomy-term-description">',
        '#suffix' => '</div>',
      );
    }
  }
}