You are here

public function ContentHubPageVariant::build in Acquia Content Hub 8

Builds and returns the renderable array for the display variant.

The variant can contain cacheability metadata for the configuration that was passed in setConfiguration(). In the build() method, this should be added to the render array that is returned.

Return value

array A render array for the display variant.

Overrides SimplePageVariant::build

File

src/Plugin/DisplayVariant/ContentHubPageVariant.php, line 20

Class

ContentHubPageVariant
Provides a page display variant that simply renders the main content.

Namespace

Drupal\acquia_contenthub\Plugin\DisplayVariant

Code

public function build() {
  $build = [
    'content' => [
      'main_content' => [
        '#weight' => -800,
      ] + $this->mainContent,
    ],
  ];
  return $build;
}