Container block - enhancement to add simple wrapper toggle option with own flex controls
I'd like to suggest an enhancement to the container block when used purely as a containing element, not in a grid block.
I've found myself using the container in nesting situations, but I don't always want or need the extra inner container div the standard cotnainer block adds for controlling inner width. Sometimes I just want to use the container as a simple wrapper/grouping element to group some items together.
I was thinking it would be very useful if the container could have a simple toggle to specify if you just wanted it to act as simple wrapper/grouping element which removes the inner div. We could then of course use all the usual GB style controls on that wrapper to effect just those items inside it as you can now.
A bonus would be if when the wrapper option was toggled, you can then specify the flexbox layout & wrap options for just that container. I believe this would be useful as then we could minimise the markup created when nesting and grouping elements and have finer control over the flexbox arrangement of the items inside. This would allow for the creation of micro UI elements where we don't have to resort to nested containers and grids which create extra divs that can add up on more complex designs/layouts.
Thanks
I agree - I've talked about this with a team a few times. You could in theory almost ditch the Grid block if this was an option. It's not an easy one to build in a back-compat way, but it's one I'd definitely like to at least attempt.
Thanks!
@tomusborne great, glad to hear you agree and it is already something you and the team have thought about.
For me personally, even if this became an option I’d want the grid to stay. One of the things that sold me on GB originally was the grid and how easy and intuitive it was to use.
Coming from other page builders, I always found limitations or frustrations with those grid implementations using sections and rows etc.
Elementor have now moved to a multi use container, similar I guess to your theory of doing away with a grid. However my take on that is the Elementor style container is not as intuitive as a grid and requires a certain understanding of flexbox to use effectively.
I often work with a lot of content people and they’d probably struggle with the Elementor container, but the GB grid is easy to work with and just makes sense to them.
I guess I’d personally like to see the best of both, retain the grid block to easily create grid structures of any type, but also have the container wrapper as a toggle on/off option for standalone containers which exposes some additional flex related settings when toggled on.
Hopefully this way would make backwards compatibility less tricky as it would just be an option on a regular container block and doesn’t change anything until you toggle the setting on to become a wrapper style container instead.
In version 1.7 we are adding flex box control to the container, button, and headline blocks.