interface DisplayInterface

Interface describing a Display configuration object.

Displays are configuration that describe the placement of block instances in regions. Drupal includes two types of Display objects:

  • Bound displays include a reference to a specific layout, and each block is specified to display in a specific region of that layout. Bound displays are used to serve real pages at request time.
  • Unbound displays do not include a reference to any layout, and each block is assigned a region type, but not a specific region. Developers including default displays with their modules or distributions are encouraged to use unbound displays in order to minimize dependencies on specific layouts and allow site-specific configuration to dictate the layout.

This interface defines what is common to all displays, whether bound or unbound.

Hierarchy

Expanded class hierarchy of DisplayInterface

All classes that implement DisplayInterface

See also

\Drupal\layout\Config\BoundDisplayInterface

\Drupal\layout\Config\UnboundDisplayInterface

File

drupal/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php, line 32
Definition of Drupal\layout\Config\DisplayInterface

Namespace

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

  /**
   * Returns the display-specific configuration of all blocks in this display.
   *
   * For each block that exists in Drupal (e.g., the "Who's Online" block),
   * multiple "configured instances" can be created (e.g., a "Who's been online
   * in the last 5 minutes" instance and a "Who's been online in the last 60
   * minutes" instance). Each configured instance can be referenced by multiple
   * displays (e.g., by a "regular" page, by an administrative page, and within
   * one or more dashboards). This function returns the block instances that
   * have been added to this display. Each key of the returned array is the
   * block instance's configuration object name, and config() may be called on
   * it in order to retrieve the full configuration that is shared across all
   * displays. For each key, the value is an array of display-specific
   * configuration, primarily the 'region' and 'weight', and anything else that
   * affects the placement of the block within the layout rather than only the
   * contents of the block.
   *
   * @return array
   *   An array keyed on each block's configuration object name. Each value is
   *   an array of information that determines the placement of the block within
   *   a layout, including:
   *   - region: The region in which to display the block (for bound displays
   *     only).
   *   - region-type: The type of region that is most appropriate for the block.
   *     Usually one of 'header', 'footer', 'nav', 'content', 'aside', or
   *     'system', though custom region types are also allowed. This is
   *     primarily specified by unbound displays, where specifying a specific
   *     region name is impossible, because different layouts come with
   *     different regions.
   *   - weight: Within a region, blocks are rendered from low to high weight.
   */
  public function getAllBlockInfo();

  /**
   * Maps the contained block info to the provided layout.
   *
   * @param \Drupal\layout\Plugin\LayoutInterface $layout
   *
   * @return array
   *   An array containing block configuration info, identical to that which
   *   is returned by DisplayInterface::getAllBlockInfo().
   */
  public function mapBlocksToLayout(LayoutInterface $layout);

  /**
   * Returns the names of all region types to which blocks are assigned.
   *
   * @return array
   *   An indexed array of unique region type names, or an empty array if no
   *   region types were assigned.
   */
  public function getAllRegionTypes();

}

Members

Namesort descending Modifiers Type Description Overrides
AccessibleInterface::access public function Checks data value access. 5
ComplexDataInterface::get public function Gets a property object. 7
ComplexDataInterface::getProperties public function Gets an array of property objects. 7
ComplexDataInterface::getPropertyDefinition public function Gets the definition of a contained property. 7
ComplexDataInterface::getPropertyDefinitions public function Gets an array of property definitions of contained properties. 7
ComplexDataInterface::getPropertyValues public function Gets an array of property values. 7
ComplexDataInterface::isEmpty public function Determines whether the data structure is empty. 7
ComplexDataInterface::onChange public function React to changes to a child property. 7
ComplexDataInterface::set public function Sets a property value. 7
ComplexDataInterface::setPropertyValues public function Sets multiple property values. 7
ConfigEntityInterface::disable public function Disables the configuration entity. 2
ConfigEntityInterface::enable public function Enables the configuration entity. 2
ConfigEntityInterface::getOriginalID public function Returns the original ID. 2
ConfigEntityInterface::setOriginalID public function Sets the original ID. 2
ConfigEntityInterface::setStatus public function Sets the status of the configuration entity. 2
ConfigEntityInterface::status public function Returns whether the configuration entity is enabled. 2
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
EntityInterface::bundle public function Returns the bundle of the entity. 3
EntityInterface::createDuplicate public function Creates a duplicate of the entity. 3
EntityInterface::delete public function Deletes an entity permanently. 3
EntityInterface::enforceIsNew public function Enforces an entity to be new. 3
EntityInterface::entityInfo public function Returns the info of the type of the entity. 3
EntityInterface::entityType public function Returns the type of the entity. 3
EntityInterface::getBCEntity public function Gets a backward compatibility decorator entity. 3
EntityInterface::getExportProperties public function Retrieves the exportable properties of the entity. 3
EntityInterface::getNGEntity public function Removes any possible (backward compatibility) decorator in use. 3
EntityInterface::getRevisionId public function Returns the revision identifier of the entity. 3
EntityInterface::id public function Returns the entity identifier (the entity's machine name or numeric ID). 3
EntityInterface::isDefaultRevision public function Checks if this entity is the default revision. 3
EntityInterface::isNew public function Returns whether the entity is new. 3
EntityInterface::isNewRevision public function Returns whether a new revision should be created on save. 3
EntityInterface::isTranslatable public function Returns the translation support status. 3
EntityInterface::label public function Returns the label of the entity. 3
EntityInterface::save public function Saves an entity permanently. 3
EntityInterface::setNewRevision public function Enforces an entity to be saved as a new revision. 3
EntityInterface::uri public function Returns the URI elements of the entity. 3
EntityInterface::uriRelationships public function Returns a list of URI relationships supported by this entity. 3
EntityInterface::uuid public function Returns the entity UUID (Universally Unique Identifier). 3
TranslatableInterface::getTranslation public function Gets a translation of the data. 3
TranslatableInterface::getTranslationLanguages public function Returns the languages the data is translated to. 3
TranslatableInterface::language public function Returns the default language. 3
TypedDataInterface::getConstraints public function Gets a list of validation constraints. 4
TypedDataInterface::getDefinition public function Gets the data definition. 4
TypedDataInterface::getName public function Returns the name of a property or item. 4
TypedDataInterface::getParent public function Returns the parent data structure; i.e. either complex data or a list. 4
TypedDataInterface::getPropertyPath public function Returns the property path of the data. 4
TypedDataInterface::getRoot public function Returns the root of the typed data tree. 4
TypedDataInterface::getString public function Returns a string representation of the data. 4
TypedDataInterface::getType public function Gets the data type. 5
TypedDataInterface::getValue public function Gets the data value. 4
TypedDataInterface::setContext public function Sets the context of a property or item via a context aware parent. 4
TypedDataInterface::setValue public function Sets the data value. 4
TypedDataInterface::validate public function Validates the currently set data value. 4