Blocks in grid layouts
Permalink 1 user found helpful
Now that grid layouts with bootstrap are so popular I was wondering how people are approaching managing the span sizes of grid boxes with custom blocks.
Say you want to allow the editor to decide the width of the block's container to put two blocks next to each other, one is span2 and the other is span10 but maybe somewhere else the same blocks are span6 and span6.
Yes I could use the built in layout option but that would sidestep the utility of using span* to manage different screens etc. Sure I could allow them to enter the span width number and output it in the block but how would that jive with other built in blocks that aren't grid friendly and so on.
Thanks!
Say you want to allow the editor to decide the width of the block's container to put two blocks next to each other, one is span2 and the other is span10 but maybe somewhere else the same blocks are span6 and span6.
Yes I could use the built in layout option but that would sidestep the utility of using span* to manage different screens etc. Sure I could allow them to enter the span width number and output it in the block but how would that jive with other built in blocks that aren't grid friendly and so on.
Thanks!
okay yeah just wondering if there is any way to be more dynamic and not have to create different page types. I guess a grid based layout module would be the only option without page types. Wonder how hard it is to modify the core layout to use grids instead.. Anybody been down that rabbit hole yet??
Yes, I have been struggling with this as well. In my opinion there is no solid solution. However C5.7 will provide better layout options. E.g. it will take into account grid systems such as Twitter Bootstrap and Foundation. Also these will be extendable.
For relatively small websites I recommend you to define your layouts in the page template files.
For relatively small websites I recommend you to define your layouts in the page template files.
See also this page:http://www.concrete5.org/about/blog/core-releases/5-7-developer-sna... and scroll down to 'Layouts'.
"They also can honor a grid system, so if you define it in your theme you can keep site operators using bootstrap columns, etc."
"They also can honor a grid system, so if you define it in your theme you can keep site operators using bootstrap columns, etc."
Awesome thanks for the link. Looks promising but now really worried about backward compatibility and upgrade path for the next version. Hope they at least provide a path to upgrade even if it takes manual steps.
So in your example, I would have one page type that would have a span2 and a span10 side by side, each with an area to add blocks. Then you could add the custom blocks to those areas and they will size accordingly. Then I would create another page type that had two span6's side by side, also with areas to add blocks.
This is just how I do it personally. I'm sure there are plenty of other ways.