In a template, is it possible to get the content of a block by the block ID? I am working with some view templates in Drupal 8, and I have the block ID of another view block I want to pull into the template. Is it possible to use the block ID to get the content of a block in a template?

If this is not possible in Twig, how could I achieve this otherwise?
Yes take a look at this module :


  Twig Blocks


https://www.drupal.org/project/twig_blocks

After module install just call the block like this in the template :

{{ render_block('machine_name_of_your_block') }}


Or in a hook :

function hook_preprocess_page(&amp;$variables)
{

    $block = \Drupal\block\Entity\Block::load('id_block');

    $variables['myBlock'] = \Drupal::entityTypeManager()
        -&gt;getViewBuilder('block')
        -&gt;view($block);

}


Then in your twig template :

  {{ myBlock }}