Blueshoe / djangocms-layouter

django CMS Layouter is a plugin for Django CMS which aims to provide a grid system for authors and editors with a high ease of use and comprehensibility.
MIT License
28 stars 4 forks source link

Let users choose breakpoints #40

Open frnhr opened 3 years ago

frnhr commented 3 years ago

Currently the breakpoints are hard-coded in the grid templates, e.g: https://github.com/Blueshoe/djangocms-layouter/blob/master/layouter/templates/layouter/bootstrap4/partials/three_cols.html#L12

The defaults are sensible but also inflexible. In my use case it makes sense to let the user configure the breakpoints manually for each layouter plugin. With some rather simple code changes I got it to work:

Screenshot_2020-10-16_at_13_37_03

A downside is that the layout can only have a single breakpoint (currently some layouts are hard-coded with two breakpoints, as in the example linked above). I think this downside can be easily countered by the user by nesting two Layouter plugins. I guess we could also implement a "Secondary breakpoint" field, but since only some layouts could make use of this field, it could be confusing and also adds complexity. IMHO anyway.

I'm interested to see if you think this could be added to Layouter plugin (can make PR). I'm not sure how this plays with Bootstrap 3, though, need to check...

frnhr commented 3 years ago

P.S.

I just noticed it should say "min width" in the dropdown 🤦