Add extra validation to "Page name after move" field | Community
Skip to main content
RickSnac
Level 2
August 13, 2024
Solved

Add extra validation to "Page name after move" field

  • August 13, 2024
  • 2 replies
  • 887 views

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.

 

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi @ricksnac 

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

 

 

 

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-on-save-in-6-5/m-p/436953

 

2 replies

ksh_ingole7
Community Advisor
Community Advisor
August 13, 2024

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-foundation-validation/

 

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. 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 13, 2024

Hi @ricksnac 

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

 

 

 

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-on-save-in-6-5/m-p/436953

 

Arun Patidar
RickSnac
RickSnacAuthor
Level 2
August 15, 2024

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?

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

 

arunpatidar
Community Advisor
Community Advisor
August 19, 2024

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