Skip to content

Instantly share code, notes, and snippets.

@phenix-factory
Last active December 15, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phenix-factory/5188422 to your computer and use it in GitHub Desktop.
Save phenix-factory/5188422 to your computer and use it in GitHub Desktop.
Drupal: render un block drupal spécifique.
<?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