1

So, I created a block using Views and I´m trying to call it from a template.

mytheme.theme file has:

function mytheme_preprocess_node(&$variables) {
$variables['block1'] = entity_load('block', $id)->getPlugin()->build(); 
}

template-of-my-page.html.twig file has:

{{ block1 }}

But I don't see any results....

I bet I'm doing something wrong, I'm not a programmer, should I add the machine name? Am I calling it wrong on Twig?

If anybody could give me a guide on how to call a block made with Views I would really appreciate it.

Please consider I'm not a programmer but I can follow instructions very well :)

0

Browse other questions tagged or ask your own question.