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

DOM within a DOM


Go to End


6 Posts   940 Views

Avatar
CraftsMan

Community Member, 35 Posts

21 December 2010 at 2:50pm

Has anyone manage to implement DOM within a 'DOM with has_many' successfully?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

21 December 2010 at 3:20pm

Yeah, Nested DOMs have been supported for over a year now.

http://www.leftandmain.com/silverstripe-screencasts/2010/08/23/nested-dataobjectmanager-a-dom-in-a-dom/

---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

Avatar
CraftsMan

Community Member, 35 Posts

23 December 2010 at 3:35am

Edited: 23/12/2010 3:35am

This doesnt work if the nest object contains has_many objects

Mu solution was to use ModelAdmin which seems to work well for what I was looking to achieve ( http://silverstripe.org/dataobjectmanager-module-forum/show/15188 )

Avatar
CraftsMan

Community Member, 35 Posts

23 December 2010 at 4:15am

UC,

When I add a nested DOM to an extended DataObject (using ModelAdmin), the DataObject tab for the DOM shows up when in add mode. Is there anyway of testing if I am in add mode so I can do a conditional add of the tab?

btw: This works as expected if I am not using DOM.

Avatar
CraftsMan

Community Member, 35 Posts

12 January 2011 at 3:19pm

bumping this up!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

12 January 2011 at 5:21pm

Yeah, I usually just do:

if($this->ID) {
// add DOM
}