3060 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2546 Views |
-
[SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

2 July 2009 at 1:12am Last edited: 5 October 2009 11:14pm
Hi,
I was wondering if it's possible to display a thumbnail of an image in the list overview in a DataObject managed by ModelAdmin.
I've tried casting it but so far without luck.Any help is appreciated, cheers.
Geert
-
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

6 July 2009 at 10:09pm
Anyone!?
*bump*
-
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

6 July 2009 at 11:44pm
Take a look at this: http://silverstripe.org/general-questions/show/263476?start=0#post263669
-
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

5 October 2009 at 11:13pm
simon_w on IRC helped me solve this issue
just add <fieldName>.CMSThumbnail.Tag to $summary_fields and you're set to go.static $has_one = array(
'TickerImage' => 'Image'
);
static $summary_fields = array(
'TickerImage.CMSThumbnail.Tag'
); -
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

9 February 2011 at 4:14am
thanks for this post! helped me out!
-
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

11 August 2011 at 4:58pm
I just wanted to add to this in case it will help someone else.
Today I was doing something similar I had the following DataObject:
class Competition extends DataObject
{
public static $db = array(
'Name' => 'Varchar(255)',
'Start' => 'SSDatetime',
'End' => 'SSDatetime'
);
public static $summary_fields = array(
'Name',
'Duration'
);
public function Duration()
{
return $this->dbObject('Start')->Full() . ' - ' . $this->dbObject('End')->Full();
}
}The problem was I would get the following error message when visiting the model admin in the CMS:
Error: "Uncaught Exception: Unable to traverse to related object field [Duration] on [Competition]" at line 2492 of /sapphire/core/model/DataObject.php
Turns out to stop this from happening all you need to do is define the searchable_fields, like so:
public static $searchable_fields = array(
'Name'
);Hopefully this will help someone else in my situation
-
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

2 November 2011 at 10:42pm
Thank god for you James! That was driving me crazy - I had got a method call to work in $summary_fields before and I couldn't work out why the hell it wouldn't work this time. Seems like a bug to me so I reported it at http://open.silverstripe.org/ticket/6761
-
Re: [SOLVED] Image thumbnail in list action (DataObject / ModelAdmin)

13 June 2012 at 2:22am
JonoM
It looks like this bug you reported is still not resolved yet... I am using 2.4.7
| 2546 Views | ||
|
Page:
1
|
Go to Top |





