Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // Get the block
  2. $block = DrupalblockEntityBlock::load('hightlight');
  3.  
  4. // Get the block content
  5. $uuid = $block->getPlugin()->getDerivativeId();
  6. $block_content = Drupal::service('entity.repository')->loadEntityByUuid('block_content', $uuid);
  7.  
  8. // Get the field value
  9. $field = $block_content->get('field_link')->getValue()[0];
  10.  
  11. $value = $block_content->get('field_link')->getValue()[0];
  12.  
  13. $value = $block_content->get('field_link')->first()->getUrl()->toString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement