Expand my Community achievements bar.

SOLVED

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

Avatar

Level 5

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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-grani...

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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-grani...