Open sephyhe opened 1 year ago
There is no maximum number of links. Best way to enforce this would be within your own project code. I've done this in the past by placing a .Limit(N)
rule in my loop, for example:
<% loop MyLinks.Limit(5) %>
...
<% end_loop %>
You can use the drag/drop ordering to manage the list in the CMS, and add a description reminding CMS users that only the first N items will be shown on the website. That way they can actually add as many as they'd like.
The LinkField, when used with a many relation, is effectively a gridfield. You might be able to use https://github.com/fromholdio/silverstripe-gridfield-limiter or https://github.com/webbuilders-group/silverstripe-limitedrelationsgridfield (or adapt some of the code if neither of those work out of the gate) to limit the number of links that can be added to the field.
Hi there,
I was wondering if you could kindly let me know if Linkfield supports a maximum number of links? I understand that having a maximum number of links could be quite useful in preventing any potential issues with breaking the FED layout.
I have attempted to find related information in the source code, however, I was unable to locate any. Would it be possible to add a parameter to support this feature and utilize it to remove the "add new" button when the gridfield reaches the maximum number? If you feel that this is a viable solution, I would be more than happy to create a pull request for you.
Thank you