Created
June 11, 2013 06:30
-
-
Save mynameispj/5754843 to your computer and use it in GitHub Desktop.
Print a Drupal 7 Block programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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
Props: http://www.wdtutorials.com/2012/04/16/drupal-7-how-to-print-blocks-in-templates#.UbYxzPbEqfM