Block List - Programmatic Allowed List and Validation
I have a block list. I would like to set the initial allowed block types to be one of five. Once they add the first block type to the list, I would like to restrict the subsequent block types to be the same block type. I would also like to change the minimum and maximum number based upon the first added block type.
Is there a programmatic way to override the block list configuration for a specific block list?
Block List - Programmatic Allowed List and Validation
I have a block list. I would like to set the initial allowed block types to be one of five. Once they add the first block type to the list, I would like to restrict the subsequent block types to be the same block type. I would also like to change the minimum and maximum number based upon the first added block type.
Is there a programmatic way to override the block list configuration for a specific block list?
I had a similar issue recently, where out of 4 possible types, only type A could be added once. You can put the following in a ContentSavingNotification handler ( https://docs.umbraco.com/umbraco-cms/reference/notifications/contentservice-notifications ) and tweak to your needs, hopefully will be enough to get you going
I can confirm this works for my needs. I also needed to know about that whole section in the documentation. This was a big help. Thank you!
is working on a reply...