How to insert a block into a node or template in Drupal 7?

后端 未结 15 1072
闹比i
闹比i 2021-01-30 01:46

In Drupal 6, it was easy to insert a block into a template with the following code:

$block = module_invoke(\'views\', \'block\', \'view\', \'block_name\');
print         


        
15条回答
  •  情歌与酒
    2021-01-30 02:19

    Just tested this in drupal 7 and it works:

    $bloqueServicios = module_invoke('views', 'block_view', 'servicios-blo_home');
    print render($bloqueServicios);
    

    Good luck!

提交回复
热议问题