Limit the Number of Values in a Multiple Value Field
The CMS supports document fields of "type" multiple. By default, the CMS imposes no limit on how many instances of such a field an author can create inside a single document. There may be a need to set an upper limit to the numer of instances of this field inside a single document, f.e. pick no more than 5 related articles for a single news item document.
You can only configure an upper limit through the Console. Navigate to /hippo:namespaces/<project-name>/<document-type>/editor:templates/_default_/<field-name> and add a property of type Long, called maxitems. The numeric value defines the upper bound on how many instances of the field you may create inside a single document. Such an upper bound is supported for both property-based fields (e.g. fields of type String) and child node-based fields (e.g. compound fields such as Link).
Below screenshot shows how an upper bound of 2 or 3 look in the CMS Document Editor. Note how the upper bound is indicated and, when reached, there is no more Add button.