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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

DOM within a DOM


Reply


6 Posts   613 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, 4092 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, 4092 Posts

12 January 2011 at 5:21pm

Yeah, I usually just do:

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