7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DOM and ModelAdmin example/overview?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 831 Views |
-
DOM and ModelAdmin example/overview?

11 July 2010 at 10:15pm
Hey All
Does anyone have a link to, or could anyone provide, a quick example or even just an overview of how to integrate DOM with ModelAdmin?
I've looked all over the place and noticed UncleCheese mention that it's now possible, but I think I might need a kick in the right direction to get started.
Would be much appreciated
Cheers
Dizzy -
Re: DOM and ModelAdmin example/overview?

12 July 2010 at 5:39am
What exactly isn't working for you? You should be able to add it the same way you do in CMSMain.
-
Re: DOM and ModelAdmin example/overview?

14 January 2011 at 7:24am
I'm aslo having trouble adding an ImageDOM to the model admin.
On my DataObject I have :
static $has_many = array (
"FrontWeb_Image" => "InventoryImage"
);...
function getCMSFields()
{$fields = parent::getCMSFields();
//Main Tab
$frontWebManager = new ImageDataObjectManager(
$this, // Controller
'FrontWeb_Image', // Source name
'InventoryImage', // Source class
'Attachment', // File name on DataObject
array(
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Main", $frontWebManager);return $fields;
}The Image DataObject look like this
class InventoryImage extends DataObject {
static $has_one = array (
'BaciItem' => 'BaciItem',
'Attachment' => 'File'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new FileIFrameField('Attachment')
);
}
}
where BaciItem is the name of the First DataObject;The ImageDOM appears on the ModelAdmin edit form, however, when I try to add an Inventory Image I have the standard dropdown for import from existing folder however when I select a folder I get another ImageDOM instead of the file list.
Perhaps some background will help. I'm trying to create an Inventory System. Each BaciItem has info related to it Description UPC etc, but it also needs to have a multiple images associated with it (back, front etc). realistically it will only ever have one of each, so I was planning on using multiple ImageDOMs, one of each image type.
Thanks
| 831 Views | ||
|
Page:
1
|
Go to Top |


