Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PreviewAwarePluginInterface.php

interface PreviewAwarePluginInterface

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\Plugin
View 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;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
PreviewAwarePluginInterface::setInPreview public function Set preview mode for the plugin. 1

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal