You are here

protected function EntityRenderHandler::getViewModeMinimalHtml in Acquia Lift Connector 8.4

Get view mode minimal HTML.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $object: The content entity object.

string $view_mode: The view mode identifier.

Return value

array The view mode minimal HTML.

1 call to EntityRenderHandler::getViewModeMinimalHtml()
EntityRenderHandler::onCreateCdf in modules/acquia_lift_publisher/src/EventSubscriber/Cdf/EntityRenderHandler.php
Actions on create CDF.

File

modules/acquia_lift_publisher/src/EventSubscriber/Cdf/EntityRenderHandler.php, line 307

Class

EntityRenderHandler
Class EntityRenderHandler.

Namespace

Drupal\acquia_lift_publisher\EventSubscriber\Cdf

Code

protected function getViewModeMinimalHtml(ContentEntityInterface $object, $view_mode) {

  // Render View Mode.
  $entity_type_id = $object
    ->getEntityTypeId();

  // @todo allow different entity types to specify how to do this.
  if ($entity_type_id === 'block_content') {
    $build = $this
      ->getBlockMinimalBuildArray($object, $view_mode);
  }
  else {
    $build = $this
      ->getViewMode($object, $view_mode);
  }
  return $build;
}