In the "New Page" dialog, how can I specify a dynamic value for a field? | Community
Skip to main content
Level 4
March 20, 2023
Solved

In the "New Page" dialog, how can I specify a dynamic value for a field?

  • March 20, 2023
  • 1 reply
  • 594 views

I have added a "granite/ui/components/coral/foundation/form/datepicker" fields to all pages in my website.

 

Whenever a new page is created, I want to default this field to the current date.

 

How can I achieve this?

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 BrianKasingli

Hi @dylanmccurry , you can write a custom client library which targets the author environment. 

Adding Custom Client Library for AEM Author Editor Touch UI

 

From there, you can write some custom javascript to check if the datefield is empty. and if it is, you can write today's date into the input field. Some example code can be found here -> https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-date-picker-libs-granite-ui-components-coral-foundation-form/m-p/251940

 

1 reply

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
March 20, 2023

Hi @dylanmccurry , you can write a custom client library which targets the author environment. 

Adding Custom Client Library for AEM Author Editor Touch UI

 

From there, you can write some custom javascript to check if the datefield is empty. and if it is, you can write today's date into the input field. Some example code can be found here -> https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-date-picker-libs-granite-ui-components-coral-foundation-form/m-p/251940