function panels_everywhere_page_variant_create in Panels Everywhere 8.4
Implements hook_ENTITY_TYPE_create().
We need to set the storage information on Panels displays being storaged in Page Manager as early as possible, to signal to Panels that features requiring Panels storage (like the IPE) are supported.
See also
File
- ./
panels_everywhere.module, line 14
Code
function panels_everywhere_page_variant_create(PageVariantInterface $page_variant) {
if ($page_variant
->getVariantPluginId() == 'panels_everywhere_variant') {
/** @var \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $panels_display */
$panels_display = $page_variant
->getVariantPlugin();
// At this point, it very likely that $page_variant->id() is NULL. But
// setting the storage type to 'page_manager' is enough to trigger Panels
// to offer the IPE as an option.
$panels_display
->setStorage('page_manager', $page_variant
->id());
}
}