Chris@0: viewMultiple([$entity], $view_mode, $langcode)[0]; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function viewMultiple(array $entities = [], $view_mode = 'full', $langcode = NULL) { Chris@0: $build_list = parent::viewMultiple($entities, $view_mode, $langcode); Chris@0: // Apply the buildMultiple() #pre_render callback immediately, to make Chris@0: // bubbling of attributes and contextual links to the actual block work. Chris@0: // @see \Drupal\block\BlockViewBuilder::buildBlock() Chris@0: unset($build_list['#pre_render'][0]); Chris@0: return $this->buildMultiple($build_list); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function getBuildDefaults(EntityInterface $entity, $view_mode) { Chris@0: $build = parent::getBuildDefaults($entity, $view_mode); Chris@0: // The custom block will be rendered in the wrapped block template already Chris@0: // and thus has no entity template itself. Chris@0: unset($build['#theme']); Chris@0: return $build; Chris@0: } Chris@0: Chris@0: }