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

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

N/A

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 295623


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>