Drupal 7 - Theme Image Style Example
Category:
If you have an image style specified in Drupal 7 and you'd like to programmatically render an image thumb nail with that image style, try something like this:
$image = theme( 'image_style', array( 'path' => 'public://my_example_image.jpg', 'style_name' => 'my_custom_image_style', 'alt' => 'Alternate Text', 'title' => 'Title Text', ) ); print $image;
This would work if you had an image style specified at admin/config/media/image-styles that was called 'my_custom_image_style'.
Comments
Alex (not verified)
Fri, 09/20/2013 - 14:12
Permalink
Thank's!
Thank's!
Josh (not verified)
Thu, 10/03/2013 - 12:13
Permalink
Thanks for sharing.
Thanks for sharing.