I’ve been looking for a way to create design patterns that contain Areas (like Containers), but allow the site editor to choose behavioral or appearance settings.
For example, this Responsive Float web component would make a great block, but I’d like the floated object to be a block instead of just an image. An editor might want to float a video, or table of contents, or card, etc.
So, I built an “Auto Grid” block as a proof of concept — Github Repo. The readme there covers all of the details.
Thanks for this. I have always wondered why it’s not possible to change a layout once it’s created. There’s a ‘Layout design’ but that doesn’t allow you to change the number of columns. If you want to do that, you have to delete the layout and build another one. The containers are also not flexible enough so what you have built is really helpful. Thanks again for making this available to the community.
One problem when removing existing areas easily is that references to the blocks inside it remain in the database.
So remove one of the cells without deleting the blocks first and then add it again and the blocks will still be there.
That might create weird behavior in the long run.
I’d love to be able to create user-configurable options for sub-area structures — the whole purpose of this block concept. But it really does seem like I’m coloring pretty far outside the lines in regards to the system design intent. Do you all agree?
It seems like the ability to add block-like settings to containers would be more in line with the system design intent, but it also seems like it would be a bigger task to implement. Blocks already have the necessary backend infrastructure. What do you think? Would block-like “container settings” be more appropriate?
I’m not really sure if it’s a real problem or not since I haven’t played around with it enough but could the ‘abandoned’ blocks be handled upon saving the block if/when a column is deleted? Perhaps ask if the person wants to save the blocks or delete them. I can see where an editor might want to keep those blocks around as they test out different layouts but at some point might want to delete them. Perhaps offer the ability to save those blocks to the clipboard upon saving the block. Just spit ballin’.
Looks like all of my posts that contain links were “flagged by the community” and hidden. Should I message a moderator? Anybody else know what to do? I couldn’t find any way to address this.
Layouts and Containers are both a special kind of block that contain sub-areas. Using the same mechanisms for your sub-areas would likely be the most core-consistent way of progressing this idea.
For orphan blocks and zombie areas, there are many pitfalls discussed in GitHub issues.