BlockContentViewBuilder::getBuildDefaults

protected BlockContentViewBuilder::getBuildDefaults(EntityInterface $entity, $view_mode)

Provides entity-specific defaults to the build process.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for which the defaults should be provided.

string $view_mode: The view mode that should be used.

Return value

array

Overrides EntityViewBuilder::getBuildDefaults

File

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

Class

BlockContentViewBuilder
View builder handler for custom blocks.

Namespace

Drupal\block_content

Code

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;
}
doc_Drupal
2016-10-29 08:47:18
Comments
Leave a Comment

Please login to continue.