You are here

private function ContextBlockPageVariant::getBuildFromBlockLayout in Context 8

Same name and namespace in other branches
  1. 8.4 src/Plugin/DisplayVariant/ContextBlockPageVariant.php \Drupal\context\Plugin\DisplayVariant\ContextBlockPageVariant::getBuildFromBlockLayout()

Get build from Block layout.

1 call to ContextBlockPageVariant::getBuildFromBlockLayout()
ContextBlockPageVariant::build in src/Plugin/DisplayVariant/ContextBlockPageVariant.php
Builds and returns the renderable array for the display variant.

File

src/Plugin/DisplayVariant/ContextBlockPageVariant.php, line 125

Class

ContextBlockPageVariant
Provides a page display variant that decorates the main content with blocks.

Namespace

Drupal\context\Plugin\DisplayVariant

Code

private function getBuildFromBlockLayout() {
  $plugin_manager = \Drupal::service('plugin.manager.display_variant');
  $display_variant = $plugin_manager
    ->createInstance('block_page', $plugin_manager
    ->getDefinition('block_page'));
  $display_variant
    ->setTitle($this->title);
  return $display_variant
    ->build();
}