/**
  * Selects the page display variant.
  *
  * @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event
  *   The event to process.
  */
 public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event)
 {
     $event->setPluginId('display_variant_test');
     $event->setPluginConfiguration(['required_configuration' => 'A very important, required value.']);
     $event->addCacheTags(['custom_cache_tag']);
     $context = new Context(new ContextDefinition('string', NULL, TRUE), 'Explicitly passed in context.');
     $event->setContexts(['context' => $context]);
 }
 /**
  * Selects the block place override of the block page display variant.
  *
  * @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event
  *   The event to process.
  */
 public function onBlockPageDisplayVariantSelected(PageDisplayVariantSelectionEvent $event)
 {
     if ($event->getPluginId() === 'block_page') {
         if ($this->requestStack->getCurrentRequest()->query->has('block-place') && $this->account->hasPermission('administer blocks')) {
             $event->setPluginId('block_place_page');
         }
         $event->addCacheContexts(['user.permissions', 'url.query_args']);
     }
 }
 /**
  * Selects the page display variant.
  *
  * @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event
  *   The event to process.
  */
 public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event)
 {
     $event->setPluginId('display_variant_test');
     $event->setPluginConfiguration(['required_configuration' => 'A very important, required value.']);
 }
 /**
  * Selects the block page display variant.
  *
  * @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event
  *   The event to process.
  */
 public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event)
 {
     $event->setPluginId('block_page');
 }