ive set 2 presets in imagecache, 1 for user profiles 1 for views. Ive set the profile setting in admin/user/settings but where do I set the views preset?

Comments

vm’s picture

I don't understand what you mean by "views preset"

if your intention is to use that derivative in the views.module you have to create a view for those images.

StarPower-Com’s picture

under admin/build/imagecache ive added some presets. Im using views to create a list but the views take the image preset size of user profiles, which is too big. so i went to admin/build/imagecache and created another preset. Im just trying make the images in the view smaller than what they are. But I dont know how to.

Thanks for the response

Graf_Fatalist’s picture

connecting to this question.
I ve copied my imagecache preset to views-view-field.tpl.php.

<?php
function hook_imagecache_default_presets(){
$presets = array();
 $presets['user_image_default'] = array (
   'presetname' => 'user_image_default',
   'actions' => 
   array (
     0 => 
     array (
       'weight' => '0',
       'module' => 'imagecache',
       'action' => 'imagecache_scale_and_crop',
       'data' => 
       array (
         'width' => '50',
         'height' => '50',
       ),
     ),
   ),
 );

}
?>

But nothing has changed. Need help :)
I have an error

Fatal error: Cannot redeclare hook_imagecache_default_presets() (previously declared in Y:\home\chessclub\www\sites\all\themes\chessclub\views-view-field--picture.tpl.php:25) in Y:\home\chessclub\www\sites\all\themes\chessclub\views-view-field--picture.tpl.php on line 44

Graf_Fatalist’s picture

<?php
$default_picture = variable_get('user_picture_default',  '');
if ($row->{$field->field_alias}) {
 print theme('imagecache', 'user_image_default', $row->{$field->field_alias});
}
else {
print theme('imagecache', 'user_image_default', $default_picture);
}
?>

It works