Last active
December 15, 2015 02:39
-
-
Save phenix-factory/5188422 to your computer and use it in GitHub Desktop.
Drupal: render un block drupal spécifique.
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 | |
/* | |
* Fait un rendu d'un block drupal. | |
* Il faut lui passer le type (Block, menu, node) et le nom machine. | |
*/ | |
$block = block_load('type', 'machine_name'); | |
/* Me demandez pas ce que ça fait, j'en ai aucune idée, mais ça marche. */ | |
$render_block = _block_get_renderable_array( _block_render_blocks(array($block))); | |
print render($render_block); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment