Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal - allow blocks to set width, instead hardcoding region widths? #16

Open
piotrpog opened this issue Sep 3, 2022 · 5 comments
Open
Assignees

Comments

@piotrpog
Copy link

piotrpog commented Sep 3, 2022

This is just a vague proposal. Lets look at bootstrap theme footer. It has three regions, each 1/3 wide.

So each block we place there, also can have 1/3 width. But what if we want to place "powered by" block, at 2/3 width? It would be impossible. We cannot set width from within block, we can just place in specific width region.

@ryssbowh
Copy link
Owner

ryssbowh commented Sep 5, 2022

1/3 width is only used for how the backend looks like in the blocks section.

The theme will then do what it wants with each region. If you needed to override how the regions look, you could override the regions.twig template in a child theme.

@piotrpog
Copy link
Author

piotrpog commented Sep 5, 2022

Regions when they are defined in defineRegions() have width setting, i assume that this width setting is later used by template by default, just like it is used n control panel when they are displayed - is that right?

@ryssbowh
Copy link
Owner

ryssbowh commented Sep 7, 2022

yes that's right, the width parameter is only used for the backend blocks page.

It's really just a visual helper for users to be able to see how the regions may look like. But it's not representative of how it really looks on the front end

@piotrpog
Copy link
Author

piotrpog commented Sep 7, 2022

Still, developer using different widths in frontend template is counter intuitive :)

What i was thinking was regions working kinda like craft cms field layout designer. In there, each row of fields could be compared to "region". Each "region has 4 slots for "blocks" - in this case "blocks" are just fields. And Field can have 1/4 width, 1/2 width, 3/4 width and full width.

Of course craft field layour does not affects frontend in any way, i was just offering this as an example.

I think such solution offers more flexibility. There could probably be 12 slots for each "row" if you implemented such thing in theme engine, because most frontend frameworks offer 12-column system for grid systems.

Anyway, i realize that implementing such thing would probably require rewriting much of code base.

@ryssbowh
Copy link
Owner

ryssbowh commented Sep 8, 2022

That's more a front end builder you're suggesting, which is not an easy feat at all.
I don't think a theme engine should force the grid system to be rows of 12 columns for example, options must be kept open and it's the theme itself that should enforce such a thing.
Having several regions layouts as you mentionned there #22 should already give more options, so I think this is way too big to be implemented now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants