public function TermRenderController::buildContent

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

Overrides EntityRenderController::buildContent

File

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

Class

TermRenderController
Render controller for taxonomy terms.

Namespace

Drupal\taxonomy

Code

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

    // Add the description if enabled.
    $bundle = $entity
      ->bundle();
    $entity_view_mode = $entity->content['#view_mode'];
    $fields = field_extra_fields_get_display($this->entityType, $bundle, $entity_view_mode);
    if (!empty($entity->description) && isset($fields['description']) && $fields['description']['visible']) {
      $entity->content['description'] = array(
        '#markup' => check_markup($entity->description, $entity->format, '', TRUE),
        '#weight' => $fields['description']['weight'],
        '#prefix' => '<div class="taxonomy-term-description">',
        '#suffix' => '</div>',
      );
    }
  }
}