Could anyone tell me how to programmatically access the field content of a custom block?
Thus far I've managed:
use Drupal\block\Entity\Block;
$block = Block::load($block_name);
if ($block) {
$render = \Drupal::entityTypeManager()
->getViewBuilder('block')
->view($block);
}
However this doesn't give me access to the fields and their data.