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

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

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.
BrianKasingli
BrianKasingliAccepted solution
New Participant
Mar 20, 2023 10:48 PM UTC

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
BrianKasingliAccepted solution
New Participant
Mar 20, 2023 10:48 PM UTC

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

 

Translate