interface UnboundDisplayInterface

Interface for a Display that is not coupled with any layout.

Unbound displays contain references to blocks, but not to any particular layout. Their primary use case is to express a set of relative block placements without necessitating any particular layout be present. This allows upstream (module and distribution) developers to express a visual composition of blocks without knowing anything about the layouts a particular site has available.

Hierarchy

Expanded class hierarchy of UnboundDisplayInterface

All classes that implement UnboundDisplayInterface

See also

\Drupal\layout\Config\DisplayInterface

2 files declare their use of UnboundDisplayInterface
Display.php in drupal/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php
Definition of Drupal\layout\Plugin\Core\Entity\Display.
UnboundDisplay.php in drupal/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/UnboundDisplay.php
Definition of Drupal\layout\Plugin\Core\Entity\Display.

File

drupal/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplayInterface.php, line 23
Definition of Drupal\layout\Config\UnboundDisplayInterface

Namespace

Drupal\layout\Config
View source
interface UnboundDisplayInterface extends DisplayInterface {

  /**
   * Returns a bound display entity by binding a layout to this unbound display.
   *
   * This will DisplayInterface::mapBlocksToLayout() using the provided layout,
   * then create and return a new Display object with the output. This is just
   * a factory - calling code is responsible for saving the returned object.
   *
   * @param \Drupal\layout\Plugin\LayoutInterface $layout
   *   The desired layout.
   *
   * @param string $id
   *   The entity id to assign to the newly created entity.
   *
   * @param string $entity_type
   *   The type of entity to create. The PHP class for this entity type must
   *   implement \Drupal\layout\Config\BoundDisplayInterface.
   *
   * @return \Drupal\layout\Config\BoundDisplayInterface
   *   The newly created entity.
   */
  public function generateDisplay(LayoutInterface $layout, $id, $entity_type = 'display');

}

Members

Namesort descending Modifiers Type Description Overrides
DisplayInterface::getAllBlockInfo public function Returns the display-specific configuration of all blocks in this display. 1
DisplayInterface::getAllRegionTypes public function Returns the names of all region types to which blocks are assigned. 1
DisplayInterface::mapBlocksToLayout public function Maps the contained block info to the provided layout. 1
UnboundDisplayInterface::generateDisplay public function Returns a bound display entity by binding a layout to this unbound display. 1