interface PreviewAwarePluginInterface in Drupal 10
Provides an interface to support preview mode injection in plugins.
Block and layout plugins can implement this interface to be informed when preview mode is being used in Layout Builder.
Hierarchy
- interface \Drupal\Core\Plugin\PreviewAwarePluginInterface
Expanded class hierarchy of PreviewAwarePluginInterface
All classes that implement PreviewAwarePluginInterface
See also
\Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent
\Drupal\layout_builder\Section::toRenderArray()
4 files declare their use of PreviewAwarePluginInterface
- BlockBase.php in core/
lib/ Drupal/ Core/ Block/ BlockBase.php - LayoutDefault.php in core/
lib/ Drupal/ Core/ Layout/ LayoutDefault.php - Section.php in core/
modules/ layout_builder/ src/ Section.php - SectionComponentBuildRenderArrayEvent.php in core/
modules/ layout_builder/ src/ Event/ SectionComponentBuildRenderArrayEvent.php
File
- core/
lib/ Drupal/ Core/ Plugin/ PreviewAwarePluginInterface.php, line 14
Namespace
Drupal\Core\PluginView source
interface PreviewAwarePluginInterface {
/**
* Set preview mode for the plugin.
*
* @param bool $in_preview
* TRUE if the plugin should be set to preview mode, FALSE otherwise.
*/
public function setInPreview(bool $in_preview) : void;
}