21301 Posts in 5735 Topics by 2603 members
| Go to End | ||
| Author | Topic: | 3258 Views |
-
Re: [Solved] Image Thumbnails in Gridfield

5 July 2012 at 4:21am
Doesn't look to be, the last commit to the effected file was a month ago.
-
Re: [Solved] Image Thumbnails in Gridfield

30 July 2012 at 12:07am
This will be fixed in 3.0.1 (currently RC2).
-
Re: [Solved] Image Thumbnails in Gridfield

10 October 2012 at 5:19pm
seems that in silverstripe 3.0.2 it works if you use
public function getThumbnail() {
return $this->Image()->CMSThumbnail();
}i just made a quick tutorial about it here too:
http://www.silverstriperesources.com/articles/silverstripe-3-0-2-grid-fields-with-thumbnails/ -
Re: [Solved] Image Thumbnails in Gridfield

19 October 2012 at 11:45am
For some reason the Futuraweb solution doesn't seem to work with ModelAdmins gridfield.
Have to use this nasty thing<?php
class SliderImage extends DataObject {static $db = array(
'Description' => 'Varchar(255)'
);static $has_one = array(
'Image' => 'Image'
);static $summary_fields = array(
'ImageNice' => 'CustomPicTitle',
'DescriptionNice' => 'CustomDescTitle'
);static $casting = array(
'ImageNice' => 'HTMLText',
'DescriptionNice' => 'Varchar'
);
public function getImageNice() {
return $this->Image()->CMSThumbnail();
}
public function getDescriptionNice() {
return $this->Description;
}
}Otherwise I get an error "Unable to traverse to related object field [Thumbnail] on [SliderImage]"
And using the casting for Description is the only way the gridfield columns pick up my custom titles aswell. -
Re: [Solved] Image Thumbnails in Gridfield

14 December 2012 at 1:33am
And using the casting for Description is the only way the gridfield columns pick up my custom titles aswell.
You can no longer change field names through $summary_fields. You should use $field_labels, "Title" => "Titel"
-
Re: [Solved] Image Thumbnails in Gridfield

29 April 2013 at 4:35pm
I've just fixed the problem when trying to add thumbnails to model admin in SS3
If you're getting "Can't traverse to [image something] on your object"
then you just need to add searchable fields, and it fixes it!
Something like this: (use your field names obviously)
static $searchable_fields = array(
'ID',
'Name'
);Rob Clarkson
| 3258 Views | ||
| Go to Top |






