Showing posts with label get block content. Show all posts
Showing posts with label get block content. Show all posts

Monday, December 19, 2011

Get block content in drupal 6 , display block in drupal 6


In drupal 6 it was

<?php

$block = module_invoke('views', 'block', 'view', 'map-block_1');
print $block['content'];

?>

arg 1 : module name
arg 2 : hook name like block
arg 3 : $op of hook_block e.g. info, view, configure
arg 4 : id or delta of the block e.g 30, map-block_1

Get block content in drupal 7 , display block in drupal 7


If you want to view blocks in drupal 7, you have to use

<?php

$block = module_invoke('views', 'block_view', 'map-block_1');
print $block['content'];

?>

arg 1 : module name
arg 2 : hook name like block_view, block_info
arg 3 : id or delta of the block e.g 30, map-block_1