How to limit character count in the title field in the create page wizard | Community
Skip to main content
joe_s66
Level 3
December 30, 2016
Solved

How to limit character count in the title field in the create page wizard

  • December 30, 2016
  • 2 replies
  • 12140 views

How can we limit character count in the title field when creating a page in the Touch UI, AEM 6.2? The create page wizard renders it via the cq:dialog node of the page properties dialog of the template's component, but I don't see where to add the js validation in the code. Thanks.  

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 joe_s66

Thanks - but here are the steps that I was looking for validating the title field in the "create page wizard":

1. Go to CRXDE and copy the /libs/foundation/components/page/cq:dialog node up to your own base page component

2. Then under the copied cq:dialog node go to cq:dialog/content/items/tabs/items/basic/items/column/items/title/items/title

3. Set the property maxlength of type Long with value to whatever you want to restrict it to

4. Save

5. Refresh the UI and try to create a page and see that now the title field length is restricted

Also, just to test and see that this solution works you could first try setting maxlength on the node under /libs/foundation/components/page/cq:dialog/content/items/tabs/items/basic/items/column/items/title/items/title

2 replies

kautuk_sahni
Community Manager
Community Manager
January 2, 2017

Hi 

Wish you a very happy new year.

Please have a look at this similar forum post:-

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__obqn-im_working_tocreate.html

//  Live character counter for title and meta description (SEO - search engine optimization) in AEM

    Classic UI:

    Add MaxLength and MaxLengthText properties to the text field and textarea nodes. you can find description to the properties on bellow link.

    https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html

    TouchUI:

    Add MaxLength propertie to the text field and textarea nodes. you can find description to the properties on bellow link.

    https://docs.adobe.com/docs/en/aem/6-1/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/form/textfield/index.html

    https://docs.adobe.com/docs/en/aem/6-1/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/form/textarea/index.html

 

Also 

    Link:- http://letsaem.blogspot.in/2015/12/implement-character-countdown-and.html

    // You can create a listener (Classic UI) where you can trigger alert message . For Touch UI refer to http://experience-aem.blogspot.in/2015/02/aem-6-sp2-touch-ui-sample-dialog-ready-event-listener.html

 

I hope this would help you.

~kautuk

Kautuk Sahni
joe_s66
joe_s66AuthorAccepted solution
Level 3
January 3, 2017

Thanks - but here are the steps that I was looking for validating the title field in the "create page wizard":

1. Go to CRXDE and copy the /libs/foundation/components/page/cq:dialog node up to your own base page component

2. Then under the copied cq:dialog node go to cq:dialog/content/items/tabs/items/basic/items/column/items/title/items/title

3. Set the property maxlength of type Long with value to whatever you want to restrict it to

4. Save

5. Refresh the UI and try to create a page and see that now the title field length is restricted

Also, just to test and see that this solution works you could first try setting maxlength on the node under /libs/foundation/components/page/cq:dialog/content/items/tabs/items/basic/items/column/items/title/items/title