Skip to content

Instantly share code, notes, and snippets.

@mynameispj
Created June 11, 2013 06:30
Show Gist options
  • Save mynameispj/5754843 to your computer and use it in GitHub Desktop.
Save mynameispj/5754843 to your computer and use it in GitHub Desktop.
Print a Drupal 7 Block programmatically
// block_load docs: https://api.drupal.org/api/drupal/modules%21block%21block.module/function/block_load/7
// Get the arguments from the second- and third-to-last segments of a block's configure URL
// For instance: /#overlay=admin/structure/block/manage/webform/client-block-150/configure
$block = block_load('webform','client-block-150');
print drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment