Skip to content

Instantly share code, notes, and snippets.

@blackice2999
Created September 25, 2014 15:45
Show Gist options
  • Save blackice2999/f8b1f854542ed183ae64 to your computer and use it in GitHub Desktop.
Save blackice2999/f8b1f854542ed183ae64 to your computer and use it in GitHub Desktop.
<?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