Provide UI and error-handling support for min-occurs, max-occurs and other schema constraints.

Under Community Review

For quite a few versions now, it's been possible to edit the schema source and put occurrence constraints on a field. Nobody uses this, because it has no effect on the way a component is displayed, and if a user violates such a constraint, the error is just nasty: certainly not a user-oriented way of saying what's wrong.

It's common enough for a site design to dictate that, say, in a given place you can put up to three widgets, or whatever. It's a real shame that you can't really do much about this until render time. The same goes for other constraints like the length of a string, or a pattern restriction. All these things would be great to have, but there's no point unless the UI also understands these constraints and displays things appropriately.

Ideally, then we'd never need to show an end user a message about violating a schema restriction, as the UI would have made it impossible, but if it were necessary, we could also do with some user-friendly reporting about why exactly you can't save the component.

Under Community Review

Some of the occurrence constraints are already enforced like min/max for multi-value fields and the rest inside Experience Manager.

The other two parts for us to consider here are:

  1. Schema options to set the available constraints
  2. Near real-time validation of the constraints for users for each type and across the UIs


Regarding the example of constraining number of Widgets in a given place on a Page: that is covered by Region constraints in Tridion Sites 9.

  • I agree with Dominic here. The main reason that I avoid it is because of the poor messaging for the users.

    It would also be useful to have some indication within the Schema that there are additional rules that aren't necessarily shown on the designer & metadata tabs.