How can we get the actual createDate of a page in the publisher with the author's details? | Community
Skip to main content
Level 6
June 13, 2022
Solved

How can we get the actual createDate of a page in the publisher with the author's details?

  • June 13, 2022
  • 3 replies
  • 1456 views

We are currently required to show the window.digitalData.createDate as the date that the AEM page is created.

When I am running ${currentPage.createDate} from sightly, I get the creationDate from the publisher. which is the wrong date (this is the create date of when the node have been replicated).

 

What I really need is the createDate from the author.

 

How can we get the actual createDate of a page in the publisher with the author's details?

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 SantoshSai

Hi @supportmember ,

Have you tried this?

${pageProperties['jcr:created'].time.toString}

Note: Replicated page and checked on publisher - which will be of course replicated date and time on publisher which turn into jcr:created

To answer your question- there is no OOTB functionality which fetches details from author on publish instance, It has to be customized!

Hope that helps!

Regards,

Santosh

3 replies

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
June 13, 2022

Hi @supportmember ,

Have you tried this?

${pageProperties['jcr:created'].time.toString}

Note: Replicated page and checked on publisher - which will be of course replicated date and time on publisher which turn into jcr:created

To answer your question- there is no OOTB functionality which fetches details from author on publish instance, It has to be customized!

Hope that helps!

Regards,

Santosh

Santosh Sai
arunpatidar
Community Advisor
Community Advisor
June 14, 2022

Hi,

You should be using a dedicated field for capturing data layer data and do not rely on AEMs internal properties.

Arun Patidar
ShaileshBassi
Community Advisor
Community Advisor
June 14, 2022

Hi,

 

OOTB the property jcr:created will contain the information when the first time the page was created on the publisher instance. So, definately it will be different from the jcr:created field present on the author environment.

 

Steps you can follow for achieving your use case:

1. Create a Replication Listener with the path restriction that it processes further if you are under the specific hierarchy, otherwise skip.
Reference: https://helpx.adobe.com/in/experience-manager/kb/ReplicationListener.html

2. Update a custom property "custom_property" at the page with the value that is present in the field "jcr:created"

3. In your logic update the code to read the "custom_property", instead of "jcr:created".

 

Thanks