Customizing validation for asset metadata fields



I'm trying to customize the validation for a couple of Asset Metadata fields. I need to make the Title and Description required. I also need to implement additional restrictions on the field values (no capital letters, no blank spaces, etc..., but I could do that on the js file). I have a few questions:

1) Why is my overlay attempt not working? (summary of what I did to follow)

2) What is the location of the javascript files that manage those fields? I wish to implement the rest of the validation there but I can't seem to find the appropriate files to edit and overlay. As a follow up, what is the recommended way to find the client side code under libs. I'm a backend dev with limited front end experience. I can work with the browser dev tools, but I often feel like I'm going through a wild goose chase.

I am able to make the fields required by adding the required parameter in the following nodes under libs



However, I when I attempted to overlay those nodes under apps I was not successful, the fields go back to not being required. I recreated the following nodes, including the required="{Boolean}true" parameter, and deleting the parameter from the nodes under libs since the ones under apps should take precedence.





Any help will be much appreciated

Accepted Solutions (1)

Accepted Solutions (1)




Hi David,

I used your problem as inspiration for this tutorial:

With regards to your question about the failed overlay, its because that part of /libs is protected. You can read about it here but basically everything under /libs/dam/content/schemaeditors is marked with the granite:InternalArea mixin type, meaning it cannot be overlaid or overriden.

The good news is that as a rule of thumb, I've found that whenever I was prevented from doing what I want because of this issue, it usually means there is a more "standard" way to approach the problem (not always though, I'll admit)

Answers (2)

Answers (2)




Hi sunjot16,

I'm sorry but I think this is completely the wrong approach If you'd like to discuss it, feel free to send me a message (so as not to pollute this thread).




Copy the entire schemaeditors node in libs and paste it under apps in the same location as it exists in libs, then try to make the changes to the items in the apps' schemaeditors/...