1

I have a Template that contains a multi-list, and the client wants said multi-list to have a limit on the count of items added to that multilist: minimum of 2, maximum of 5.

Is there an OOTB validation rule that can do this? I've looked through the samples, and can't see anything that seems relevant.

I've not been able to find online documentation that actually documents what is available in the Sitecore.Data.Validators (though that might be my unfamiliarity with sitecore documentation) to see if I can write my own, so if anyone has a link to the documentation that covers what is in the Sitecore.Data.Validators.* or Sitecore.Kernel that are in the Data/Type field for the sample validation rules would be appreciated too.

1 Answer 1

2

While not intuitive, you can do this with the Regular Expression validator. Add one to your field.

Use the expression ^({[^}]+}\|?){2,5}$

(2,5) is thw boundaries you mention in your question.

Source: https://mskutta.github.io/2019/08/20/sitecore-how-to-limit-the-number-of-items-selected-in-a-treelist-field/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.