Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

trying to adapt ressource example to modeladmin

Go to End

11 Posts   2076 Views


Community Member, 211 Posts

17 June 2011 at 5:51am

Edited: 17/06/2011 6:02am

Hello Uncle cheese

Sorry for the previous post

I got it almost to work.

When I create a work :
I got to tabs
Main where I can putthe 'name' and define categorie attached to the work
Files where I can upload files

When I add (save) the work I get to see a third tab wich seems normal according to :

new MultipleFileUploadField('UploadedFiles','Files'));

But I'm left with a problem
There is no thumbnail when I save the uploaded file
also There is nothing in the UploadedFiles tab.

class Work extends DataObject {

static $db = array(
'Name' => 'Varchar'

static $has_one = array(
'Category' => 'Category'

static $has_many = array (
'UploadedFiles' => 'WorkFile'

static $searchable_fields = array(

public function getCMSFields() {
$fields = parent::getCMSFields(); 
$fields->addFieldToTab("Root.Files", new MultipleFileUploadField('UploadedFiles','Files');
return $fields;

I'm gonna try to find out by myself but if you have any idea



Forum Moderator, 4102 Posts

21 June 2011 at 4:55am

You need to populate the dropdown with options..

$map = array();
if($result = DataObject::get("Category")) {
$map = $result->toDropdownMap();


new DropdownField('CategoryID','Category',$map);


Community Member, 211 Posts

21 June 2011 at 5:23am


I'm getting confused ;)

Here you're talking about the categori dropdown right ?

It seems to be working now after I set up a tab to upload the files.

My problem now is that after I save the uploaded files the images seems to desapear and there is nothing under the tab uploaded file.

(in the ressource example you get to see what has been uploaded)

Maybe I'm doing something wrong or not understanding how it works


Go to Top