-
Notifications
You must be signed in to change notification settings - Fork 638
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
Minimum number of rows in Matrix fields #850
Comments
This would be very useful. Just like you can do with Matrix in EE. |
This would be great Min Blocks |
To improve the AX, Matrix fields with less than the minimum should get placeholder blocks instead of the Add Block buttons. Placeholder blocks just show a list of the available block types, and when you choose one, it will become that block type. (Placeholder blocks will reappear if a block is deleted, as well.) If a Matrix field has both Min Blocks and Max blocks set to identical values, then the Add Block buttons should never be shown. |
Would love this feature as well. |
Are there any updates on this feature. I would love to have it. I run into this need quiet frequently. |
Just added it for Craft 3, albeit without my "placeholder blocks" idea. Unfortunately I couldn’t add it for Craft 2, because in Craft 2, custom field validation only gets triggered if the field value is not empty. Assumption being that if you don’t want an empty value, you will mark the field as required, which is a fair assumption in most cases, but not if the field happens to have a “Min Blocks” setting, which should effectively make the field required everywhere it’s used. |
This feature is not implemented right now? |
@davidhellmann I suppose we could do that if there’s only one block type. |
@brandonkelly |
@davidhellmann: shake of head here, about your approach. Brandon & co, and the community here, do and deserve better, no? As far as your details, have a look and see how many cases and persons he's completed today. Maybe you just needed to be more clear in description, so it will be more likely to get it all the first time? |
@narration-sd don't know what you mean and my last commend was a bit l fun. |
lol, no worries @davidhellmann ! @lukeyouell created a dedicated issue for this too (#2353), and it's fixed for the next release. (FFR please create new issues for new bugs 🙏 thanks!) |
Its is very nice to be able to specify the max number of rows in a Matrix but I think specifying the minimal number of rows would be interesting too in many cases.
By combining those two settings you would be able to create Matrix fields needing 3 and only 3 components. That would give you tighter control over your content model / data structure while letting users benefit from the reordering / add / delete capabilities of Matrix.
Use cases:
a simple grid of icons, titles and text. If your wide screen layout calls for three items or more, there is currently no way to enforce that with Matrix
when building more complex data grids (2 items, 3 items, 4 items per "row") having such a parameter would allow for a simpler data structure while preserving the reorder / add / delete and configure options currently given by Matrix
The text was updated successfully, but these errors were encountered: