Is it possible to make validation name authorable? Need to choose between admin.pagename(default) and my custom validation. It needs to be managed by author. Author will provide this information in a separate page template and the value will be used in each page validation name.
Solved! Go to Solution.
Hello @Nusrat_Jahan,
I assume you want to force the author to create human readable node/page-name or to generate SEO friendly URL.
In such case, instead of breaking into OOTB JS validation, I would suggest to do the following
- Implement a replication pre-processor (https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/replicatio...
- With in that, check if you have custom validation is enabled or not, based on that block or allow the page from being published
Justification of this solution would be:
- Readable name or SEO friend URL is mainly the ask for publisher
- Author can anyway go ahead and update the node name (by move operation)
- Keeping the OOTB validation (in page properties) intact
See if this solution make sense, please let me know..
Thanks
hi @Nusrat_Jahan IMO, you can create a scheduled sling job over here which perform the following steps:
1. read the configuration for the page validation
2. your job to execute the service to get all the names of the pages on which this validation needs to be executed.
3. your job to execute the service either to correct the names as per the rules defined in your configuration as in Step 1 or use a report to download and fix it.
Report Process
Hope this helps!
Thanks
Hello @Nusrat_Jahan,
I assume you want to force the author to create human readable node/page-name or to generate SEO friendly URL.
In such case, instead of breaking into OOTB JS validation, I would suggest to do the following
- Implement a replication pre-processor (https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/replicatio...
- With in that, check if you have custom validation is enabled or not, based on that block or allow the page from being published
Justification of this solution would be:
- Readable name or SEO friend URL is mainly the ask for publisher
- Author can anyway go ahead and update the node name (by move operation)
- Keeping the OOTB validation (in page properties) intact
See if this solution make sense, please let me know..
Thanks
Yes, I think it is possible. The only thing you need to do is register 2 validators, your custom one and the default one, then based on a "class" or some other sort of flag, the validator will check which validation needs to be triggered against the field is being authored. Then you just need to make sure to add the flag accordingly in the field based on the author selection.
See more here:
Views
Likes
Replies
Views
Likes
Replies