function ExtraFieldBlock::getPreviewFallbackString
Same name in other branches
- 9 core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php \Drupal\layout_builder\Plugin\Block\ExtraFieldBlock::getPreviewFallbackString()
- 10 core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php \Drupal\layout_builder\Plugin\Block\ExtraFieldBlock::getPreviewFallbackString()
- 11.x core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php \Drupal\layout_builder\Plugin\Block\ExtraFieldBlock::getPreviewFallbackString()
1 call to ExtraFieldBlock::getPreviewFallbackString()
- ExtraFieldBlock::build in core/
modules/ layout_builder/ src/ Plugin/ Block/ ExtraFieldBlock.php
File
-
core/
modules/ layout_builder/ src/ Plugin/ Block/ ExtraFieldBlock.php, line 143
Class
- ExtraFieldBlock
- Provides a block that renders an extra field from an entity.
Namespace
Drupal\layout_builder\Plugin\BlockCode
public function getPreviewFallbackString() {
$entity = $this->getEntity();
$extra_fields = $this->entityFieldManager
->getExtraFields($entity->getEntityTypeId(), $entity->bundle());
return new TranslatableMarkup('"@field" field', [
'@field' => $extra_fields['display'][$this->fieldName]['label'],
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.