custom blocks with areas in them

Permalink
Is it possible to create blocks with open ended areas in them like in a theme/page type?

I am aware of designer content which is awesome but I'd like to create blocks that contain structured predefined markup with generic areas rather than predefined block types like image, file, content etc.

I tried including an area in a custom block and it almost worked you can edit it in edit mode but not save it (the save button doesn't do anything, no error either).

zanedev
 
enlil replied on at Permalink Reply
enlil
you should be able to display an area from within a block coding it just like you would in a page type. I've modified some core blocks before to add another area to ecommerce product display blocks for instance and it worked fine. Check out my enlil global areas add on in the marketplace for an example of how i did it for "global" areas!
zanedev replied on at Permalink Reply
zanedev
thanks enlil I checked it out and it does let you embed pre-existing blocks from other pages which is almost what I would like to do. It's looking up the page blocks from the page and displaying their content but just adding an area to a block's edit.php to use the generic add block popup doesn't work like:

$a = new Area('My Open Ended Area');
            $a->display($c);


I'd like to simply put open ended editable areas in a block similar to a page theme so another words you could have a block that is just like a page in edit mode when you edit it, a layout is visible with basic areas for generic blocks or hard coded blocks or whatever.

Instead of a form with predefined fields that you fill out in edit mode, more like in page editing where it shows the layout and you can edit/add any combination of blocks directly to that block using areas.
enlil replied on at Permalink Reply
enlil
ok, i understand what your getting at now! I've tried to accomplish this in the past as well and couldn't figure it out. My approach was to put the areas in the block, then when editing the block get the areas to be editable. I was really close but could never quite get it to work.
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Making an area (or stack) display from within a block is not that difficult. However, the entire c5 page edit mode mechanism is not designed to facilitate editing blocks within blocks. To do what you want with edit mode support I suspect you would need to re-write the javascript that does editing pretty much from scratch.
zanedev replied on at Permalink Reply
zanedev
Thanks I came to the same conclusion. Bummer that would be the ultimate use of a block instead of having it form based in edit mode having an actual edit in place layout.

I'm finding all the other methods to be lacking in one way or another and a lot more work on the editor to wrap things when needed etc. That feature alone would remove the need for most of the workarounds in the marketplace regarding blocks.