Sorry, we don't support your browser.  Install a modern browser

Layout field: min/max blocks#180

Blocks are very similar to structure field and limits are useful. For example you want to use them for “slot”. Or if i have two colum layout i want people to be able to add only single block to each colum (image and text).

Not sure if min/max on layout would make sense and it would probably get pretty complicated.

3 years ago
Changed the title from "[Blocks] Min/max for blocks" to "Min/max blocks for layout field"
3 years ago

This would be super help, when you have complex layout grids that can be broken by the client clicking the wrong add button

3 years ago

I see multiple case where it would be useful…!

3 years ago

@iskrisis I know I am late to the party, but what exactly would min/max refer to on the layout field. The number of blocks overall? The number of blocks in eahc column? Any way to specify different min/max for different columns?

a year ago

@Nico Yes, number of blocks of column. You can check out my comment related feature that included this limit prop: https://kirby.nolt.io/297

a year ago

For a client of mine, I used the layout field to allow them to build a custom header layout. I’ve “hacked” a limit together with CSS, but drag-and-drop would still work. In this case, the layout would break (third image) if you add more than 1 block in each column. Having a limit option would allow a more versatile use of the layout block for cases like this.

a year ago