Expand my Community achievements bar.

SOLVED

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

Avatar

Level 6

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @AEMWizard ,

Have you tried this?

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

Screen Shot 2022-06-13 at 7.11.09 PM.png

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

Avatar

Community Advisor

Hi,

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



Arun Patidar

Avatar

Correct answer by
Community Advisor

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