1

How can i use block regions in my node.html.twig in drupal 8 ?

i tried this :

block_get_blocks_by_region

but function not found

2
  • Try \Drupal::entityManager()->getStorage('block')->loadByProperties(['region' => $region, 'theme' => \Drupal::theme()->getActiveTheme()->getName()]);
    – user21641
    Jan 11, 2016 at 8:26

1 Answer 1

1

Fixed by adding this function to my theme

function YOURTHEME_preprocess_node(&$variables) {

$block = \Drupal\block\Entity\Block::load('views_block__sidebar_meetings_group_page');
$variables['block_output'] = \Drupal::entityManager()
  ->getViewBuilder('block')
  ->view($block);

}

thanks @ivan jaros and @berdir

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.