Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our AEM Community Member of the Year!
SOLVED

Add extra validation to "Page name after move" field

Avatar

Level 2

I'd like to only allow lowercase letters to this field. Is there a way add this or change the validation regular expression?

The field has some validation, but I can't find where this is set.

 

RickSnac_0-1723539165078.png

The field checks on spaces and wierd characters, but not uppercase letters.

RickSnac_0-1723539439156.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @RickSnac 

The Validator is from OOTB clienlibs i.e. /libs/cq/gui/components/siteadmin/admin/clientlibs/validations

 

arunpatidar_0-1723551678649.png

 

 

but you can't change this, however you can have additional Custom Validator using clientlibs with category 'cq.sites.movepagewizard' 

 https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/validate-page-properties-o...

 



Arun Patidar

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @RickSnac 

 

To write custom validation for Touch UI dialog fields the recommended approach is to use foundation validator validations. Please refer this document below to write a custom one. https://blogs.perficient.com/2017/11/06/aem-touch-ui-dialog-validation-new-best-practice-use-foundat...

 

And to know where the validation for your current field are written, you need to check the resoureceType of that field. For e.g If the field/widget is coming from /libs you should be able to find the validation script there. You might need to dig in a little to find the exact script. 

Thanks. 

Avatar

Correct answer by
Community Advisor

Hi @RickSnac 

The Validator is from OOTB clienlibs i.e. /libs/cq/gui/components/siteadmin/admin/clientlibs/validations

 

arunpatidar_0-1723551678649.png

 

 

but you can't change this, however you can have additional Custom Validator using clientlibs with category 'cq.sites.movepagewizard' 

 https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/validate-page-properties-o...

 



Arun Patidar

Avatar

Level 2

Thanks for your great answer. I managed to fix the problem!

Something else turned up now. When content editors copy a page and paste afterwards they can enter a new page name (url path). This field also needs the same validation. Do I have to repeat everything for a different category? Something like 'cq.sites.movepagewizard'? Or is there a more obvious method?
RickSnac_0-1723714925260.png

Note: the label of the field is badly named imo, but it sure is the url path the user can enter here. 

 

Avatar

Community Advisor

Hi @RickSnac 
Unfortunately, there is another place where autocorrection/validation is placed for copy/paste page

/libs/cq/gui/components/common/wcm/clientlibs/wcm/js/copy.js

 

 

Clientlibs details are at : /libs/cq/gui/components/common/wcm/clientlibs/wcm



Arun Patidar