Created
June 18, 2013 22:00
-
-
Save elliottb/5809846 to your computer and use it in GitHub Desktop.
Drupal 6 i18n compatible replacement for module_invoke() that displays a block with block delta (encoded name) and region. Replaces this logic: $block = module_invoke('menu', 'block', 'view', 'menu-responsive-platforms');
print $block['content']; With logic that is language (i18n) friendly. Adapted from here: http://stackoverflow.com/questions/4…
This file contains hidden or 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
function render_i18n_block($block_name, $region = "hidden") { | |
if ($list = block_list($region)) { | |
foreach ($list as $key => $block) { | |
if ($block_name == $block->delta){ | |
print $block->content; | |
} | |
} | |
} | |
} | |
//usage | |
print render_i18n_block('my-block', 'footer'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment