mrflix
1
Use Case
I want to create an image grid using layout
and the image
block and I want to limit the amount of images per layout column to one image per column.
Question
The blocks field has the max
that I’d use but I don’t see a way set this from within the layout field. I’d expect this to work:
layout:
label: Photos
type: layout
layouts:
- "1/1"
- "1/2, 1/2"
- "1/3, 1/3, 1/3"
fieldsets:
- image
blocks:
max: 1
No, there is no such setting and since you want this per column, not per layout, that setting wouldn’t make sense anyway.
Maybe it would make more sense to use a custom block types for the grid rather that the layout field?
I just did something in the panel.css to avoid creating more than one block, it’s not a perfect solution but it helps:
.k-block + .k-block-options .k-block-options-button:nth-child(2),
.k-block + .k-block-options .k-block-options-button:nth-child(5) {
display: none;
}
Users can’t create new blocks in a row and are not able to drag&drop from a column to another.