At the moment we're developing a website which consists of pages which are to be entirely populated by "blocks" of content. The content author should be able to add as few as one block of content to a page, but also be allowed to add as many blocks of content as he wants to, in any order. All the blocks will be floated next to one another in the template and overflow to the next "line" when necessary (or when the content author decides a new line of blocks should start).
These blocks can be thought of as widgets. In fact, we've developed a similar website before using SilverStripe's Widget functionality to make the above description possible. However, we found that while Widget sounds like the most plausible approach, in practice it is lacking due to not being very organized (visually) and due to the fact that much hacking is needed to get certain FormField types to work in widgets.
Therefore, we are now trying a new approach with the current website, by developing the blocks of content as DataObjects and managing their order in a DataObjectManager. I've set up a "master" DataObject class which has a few DB fields which are shared among all the different content blocks (e.g. TextBlock, ImageBlock, VideoBlock, FormBlock, etc.) and a few other DataObject classes which have their own unique DB fields.
My question (finally ;-)) is whether or not there is any way to get a DataObjectManager to display all of the different classes representing blocks of content in a single DOM? When creating a DOM, one of the arguments is the source class and I've used the master class there. The $has_one and $has_many relationships between the classes are set up correctly. What I would like, is to be able to use the DOM's "Add" button to add any one of the block types (influencing the fields shown in the DOM popup) and also see the different block types listed in the same DOM instance.
Is any of this possible or are we marching in the wrong direction entirely by trying to use the DataObjectManager for this scenario? I've actually managed to get about halfway there today by "abusing" DataObjectManager a bit through JavaScript and using onAfterWrite(), but so far I'm not sure that is the way to go as I feel that is making the whole thing too complicated...