World is now on Opti ID! Learn more
World is now on Opti ID! Learn more
Hi Tran
If you use the IContentRepository.Copy method, or if the user is copying in the CMS UI, then all the properties is copied as-is. It is the same as expoting and importing the page.
You will not be able to catch those copy actions specifially with the IContentEvents methods.
If you are going to copy the pages programmatically, then you can just clone and publish the page.
Or if you want to "get your hands dirty", you could try to replace the EPiServer.Core.Transfer.Internal.ChangeTrackablePropertyTransform. Here you can try to override ImportProperty. If the property name is PageCreated you can put your own timestamp.
But it would also apply to everything else that is imported. So you could maybe limit it to some known destination or something.
Hi developers,
Posting here, hoping to get some help.
I’m encountering an issue with setting the created date programmatically for page content. When copying a page, the Created and Published Dates are retained from the original page, but I expect these dates to update to the time when the page is copied.
I tried using the
CreatedContent
event ofIContentEvents
, but it didn’t work. Has anyone experienced this issue before?[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]