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

后端 未结 15 1074
闹比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:11

    This worked for my Drupal 7 , URL: admin/structure/block/manage/addthis/addthis_block/configure NOTE:delta and module name present in the url itself

    $addblock = module_invoke('addthis','block_view','addthis_block');
    print render($addblock['content']);

    More information can be found on http://technarco.com/drupal/insert-block-node-or-template-drupal-7

提交回复
热议问题