Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293926

Allow block plugins to determine if they are being previewed

$
0
0

Problem/Motivation

#2992410: Provide placeholders for empty blocks (for example, an empty Views listing) added the ability for blocks to specify a preview fallback string.

However, this is only triggered when the block returned is empty.
There is currently no way for the block to know if it is being previewed.

See #3027593: Empty facet blocks with Layout Builder

Proposed resolution

Allow blocks to retrieve the preview value by context.
As the block.module does not use the concept of preview, this is only needed in Layout Builder at the moment.

Remaining tasks

Pending subsystem maintainer review on the proposed strategy (in #26) for addressing the concern raised in #16.

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293926

Trending Articles