function BlockContentViewBuilder::getBuildDefaults

Same name in other branches
  1. 9 core/modules/block_content/src/BlockContentViewBuilder.php \Drupal\block_content\BlockContentViewBuilder::getBuildDefaults()
  2. 8.9.x core/modules/block_content/src/BlockContentViewBuilder.php \Drupal\block_content\BlockContentViewBuilder::getBuildDefaults()
  3. 11.x core/modules/block_content/src/BlockContentViewBuilder.php \Drupal\block_content\BlockContentViewBuilder::getBuildDefaults()

Overrides EntityViewBuilder::getBuildDefaults

File

core/modules/block_content/src/BlockContentViewBuilder.php, line 42

Class

BlockContentViewBuilder
View builder handler for content blocks.

Namespace

Drupal\block_content

Code

protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
    $build = parent::getBuildDefaults($entity, $view_mode);
    // The content block will be rendered in the wrapped block template already
    // and thus has no entity template itself.
    unset($build['#theme']);
    return $build;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.