Original parent page of deleted page

Vote:
 

Content editor can restore previously deleted pages from recycle. 

How EPiServer knows destination to restore page?

Is it possible to get this data during rendering deleted page using direct url?

I need to know previous page location (before moving to recycle).

I hope for your help. All the best, Pavel

#147413
Apr 13, 2016 22:02
Vote:
 

You should check out this EPiServer interface

public interface IParentRestoreRepository
  {
    void SaveParentLink(ContentReference sourceLink, ContentReference parentLink);

    ContentReference DeleteParentLink(ContentReference sourceLink);

    ContentReference GetParentLink(ContentReference sourceLink);
  }

It's located in EPiServer.DataAccess and handles storing information about original parent during move event to wastebasket. Grab an instance from the ServiceLocator :)

Under the hood it uses the Dynamic Data Store DDS to store the references.

In SEO Manager we keep track of deleted pages to be able to render a custom 410 but then we store the previous url in moved event combined with guid to the content. So that's another possible solution. I'm guessing you want to build some nice 404/410 handling right?

#147416
Edited, Apr 13, 2016 23:11
Vote:
 

Thanks Daniel,

I'm planning to use this mostly in different scenario. 

P.S. It works only for ContentReference without work id.

All the best,

Pavel 

#147449
Apr 14, 2016 15:33
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.