I'm trying to render or print my custom blocks on my node twig template and currently receiving a fatal error message.
Argument 1 passed to Drupal\block\BlockViewBuilder::view()
Here is the snippet of code I'm working on my .theme
file
function iom_preprocess_node(&$variables) {
$block = \Drupal\block\Entity\Block::load(917);
$block_content = \Drupal::entityTypeManager()
->getViewBuilder('block')
->view($block);
}
$block
returns NULL
when I try to do a dump($block)
$block = \Drupal\block\Entity\Block::load(917);
dump($block);
Tried using twig tweak
also to resolve the issue instead of having to pre-process it but no luck
{{ drupal_block('twitterfeed') }}
NULL
. Checked the Block ID and it was correct