// Hide contextual links for inline blocks until the UX issues surrounding
// editing them directly are resolved.
// @see https://www.drupal.org/project/drupal/issues/3075308
if (!
$block instanceof InlineBlock && !
empty($content['#contextual_links'
])) { $build['#contextual_links'
] =
$content['#contextual_links'
];
} $build['content'
] =
$content;
if ($event->
inPreview()) { if ($block instanceof PreviewFallbackInterface
) { $preview_fallback_string =
$block->
getPreviewFallbackString();
} else { $preview_fallback_string =
$this->
t('"@block" block',
['@block' =>
$block->
label()]);
} // @todo Use new label methods so
// data-layout-content-preview-placeholder-label doesn't have to use
// preview fallback in https://www.drupal.org/node/2025649.
$build['#attributes'
]['data-layout-content-preview-placeholder-label'
] =
$preview_fallback_string;
if ($is_content_empty &&
$is_placeholder_ready) { $build['content'
]['#markup'
] =
$this->
t('Placeholder for the @preview_fallback',
['@preview_fallback' =>
$block->
getPreviewFallbackString()]);
}