impresspages/ImpressPages-CMS — pull request #301 by chrisv2 (2013-10-07 14:30:46+00:00)
Title: Allow nesting of widgets / blocks

This patch allows nesting widgets, by allowing ipBlock inside ipWidget.

IMHO, this would be a very useful addition to IP because it will allow widgets to provide layout, while allowing arbitrary content. For an example what can be possible please see my MultiColumn widget at https://github.com/greybyte/ImpressPages-extra-plugins/tree/master/multicolumn

Technical Explanation
--------------------------------
The rationale for nesting widgets is that every block should only listen to events of its immediate .ipWidget children, and ignore events which bubble up from nested widgets.

ipBlock._createWidgetResponse takes care of initializing any descendent blocks which may appear when new widget is inserted. This required small refactor of ipContentManagement plugin, to enable only initializing selected bocks.

In the same fashion, when a widget is deleted, delete event will be sent to all contained widgets first, before hosting widget gets deleted. This part may be improved, as noted in the TODO, but I wanted to keep impact of the patch low for the moment. If this gets merged, I can provide another patch to add required multiple delete function.