I'm trying to show a thumbnail in summary gridfield.
static $has_many = array( 'Images' => 'Image');
static $summary_fields = array(
'Title' => 'Title',
'Thumb' => 'Thumb'
);
public function getThumb()
{
if($this->Images()->count())
{
$image = $this->Images()->first();
return $image->CMSThumbnail();
}
else return "No images.";
}
$image contains the correct Image object, but CMSThumbnail returns null, why?
Maybe I found the problem, but i can't solve it.
$image->Filename returns assets/{imageName}
Images are uploaded in 'assets/upload', but Silverstripe looks for them in assets. Why?