After lot of research, finally got the way to render blocks in twig files.
Basically there are two type of renders. When there is an existing instance of the block in the layout.
The the block can be rendered in twig using preprocess as
$block = Block::load('serchform');
$variables['block_content'] = \Drupal::entityTypeManager()
->getViewBuilder('block')
->view($block);
print render($variables);
No comments:
Post a Comment