public function OverridesSectionStorage::getContextsDuringPreview in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getContextsDuringPreview()
Gets contexts for use during preview.
When not in preview, ::getContexts() will be used.
Return value
\Drupal\Core\Plugin\Context\ContextInterface[] The plugin contexts suitable for previewing.
Overrides SectionStorageBase::getContextsDuringPreview
File
- core/
modules/ layout_builder/ src/ Plugin/ SectionStorage/ OverridesSectionStorage.php, line 311
Class
- OverridesSectionStorage
- Defines the 'overrides' section storage type.
Namespace
Drupal\layout_builder\Plugin\SectionStorageCode
public function getContextsDuringPreview() {
$contexts = parent::getContextsDuringPreview();
// @todo Remove this in https://www.drupal.org/node/3018782.
if (isset($contexts['entity'])) {
$contexts['layout_builder.entity'] = $contexts['entity'];
unset($contexts['entity']);
}
return $contexts;
}