Next Tutorial

Drupal 7 Tutorial Part 16: Drupal 7 Reports & Logs Explained

How to display programatically preset images using imagecache function API in Drupal ?

Submitted by anilsagar on Mon, 08/08/2011 - 10:41

Hi,

If you want to print images using imagecache presets in the custom drupal module development or programatically use below API function.


<?php print theme('imagecache', ‘my_preset’, $file_path, $alt, $title, $attributes); ?>

Replace my_preset with imagecache preset name.
$file_path with image path. like 'sites/default/files/xyz.jpg'
$attributes for img attributes like class etc...

0 comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.
©2010 AnilSagar. All rights reserved. Drupal theme by Kiwi Themes.