Last active
December 19, 2015 05:29
-
-
Save chadmandoo/5904584 to your computer and use it in GitHub Desktop.
Drupal programmatically render a block
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
<?php | |
//module_invoke('module_name', 'block_view', 'block_identifier') | |
//Printing using Drupal block system | |
$block = module_invoke('block', 'block_view', '1'); | |
print render($block['content']); | |
//Printing using a contrib module block, this example uses the weather module | |
$block = module_invoke('weather', 'block_view', 'user'); | |
print render($block['content']); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment