Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function naturetour_page_attachments_alter(array &$attachments){
- $uuid = \Drupal\block\Entity\Block::load('usefull')->getPlugin()->getDerivativeId();
- $block_content = \Drupal::service('entity.repository')->loadEntityByUuid('block_content', $uuid);
- if ($block_content) {
- $field_value = $block_content->field_something_item->value;
- $attachments['#attached']['drupalSettings']['naturetour']['custom']['something_item'] = $field_value;
- }
- }
Add Comment
Please, Sign In to add comment