function BlockContentViewBuilder::getBuildDefaults
Same name in other branches
- 9 core/modules/block_content/src/BlockContentViewBuilder.php \Drupal\block_content\BlockContentViewBuilder::getBuildDefaults()
- 10 core/modules/block_content/src/BlockContentViewBuilder.php \Drupal\block_content\BlockContentViewBuilder::getBuildDefaults()
- 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 35
Class
- BlockContentViewBuilder
- View builder handler for custom blocks.
Namespace
Drupal\block_contentCode
protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
$build = parent::getBuildDefaults($entity, $view_mode);
// The custom 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.