Created
September 25, 2014 15:45
-
-
Save blackice2999/f8b1f854542ed183ae64 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* @file | |
* | |
* @see http://drupal.org/user/413429 | |
*/ | |
function hook_block_view($delta = '') { | |
$block = array(); // <-- this is a render array also! | |
switch ($delta) { | |
case 'foo': | |
$block['content'] = array(); | |
// This is a render array the theme function theme_image_style will be called on somewhere in the theme wenn | |
// it will be rendered by drupal_render() or render() | |
$block['content']['myfirstimage'] = array( | |
'#theme' => 'image_style', | |
'#style_name' => 'full', // <--- image style for thumbnail creation you create it in image style settings | |
'#path' => drupal_get_path('module', 'mymodule') . '/images/image1', // Path to original image (only a example) | |
); | |
$block['content']['mysecondimage'] = array( | |
'#theme' => 'image_style', | |
'#style_name' => 'full', // <--- image style for thumbnail creation you create it in image style settings | |
'#path' => drupal_get_path('module', 'mymodule') . '/images/image1', // Path to original image (only a example) | |
); | |
break; | |
} | |
return $block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment