Skip to content

Instantly share code, notes, and snippets.

@jeremycaldwell
Last active January 20, 2017 05:37
Show Gist options
  • Save jeremycaldwell/6395084 to your computer and use it in GitHub Desktop.
Save jeremycaldwell/6395084 to your computer and use it in GitHub Desktop.
Drupal 6/7 - Embed block in node
<?php
$block = module_invoke('views', 'block' , 'view', 'fanvision_news-block_1');
print $block['content'];
?>
<?php
$block = block_load('system', 'main-menu');
$content = _block_get_renderable_array(_block_render_blocks(array($block)));
$output = drupal_render($content);
echo $output;
?>
@jeremycaldwell
Copy link
Author

Hover over the block's configuration link on the Blocks page to get the machine name.

Example: my_view-block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment