Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get the block
- $block = DrupalblockEntityBlock::load('hightlight');
- // Get the block content
- $uuid = $block->getPlugin()->getDerivativeId();
- $block_content = Drupal::service('entity.repository')->loadEntityByUuid('block_content', $uuid);
- // Get the field value
- $field = $block_content->get('field_link')->getValue()[0];
- $value = $block_content->get('field_link')->getValue()[0];
- $value = $block_content->get('field_link')->first()->getUrl()->toString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement