More in this section

Forums / Developing with Sitefinity / Programmatic Recycle vs. Delete SF 7.1

Programmatic Recycle vs. Delete SF 7.1

2 posts, 0 answered
  1. Scott Rozman
    Scott Rozman avatar
    93 posts
    10 Oct 2012
    22 Jul 2014
    Link to this post

    Today, I looked into how to recycle content items from the Module Builder instead of delete them.

    It would have been nice to see this in the generated API documentation for my content types, but I found this other documentation which got me part of the way.

    The technique is almost the same as the news version above:


    So instead of just getting the data item and moving it to the recycle bin, you need to get the data item, get its master and then move the master.

    Since the documentation is still a bit sparse, I thought I'd post this.

    DynamicContent resourceItem = dynamicModuleManager.GetDataItem(resourceType, resourceID);
    var master = dynamicModuleManager.Lifecycle.Edit(resourceItem) as DynamicContent;
    if (master != null)

  2. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    31 May 2017
    25 Jul 2014
    Link to this post

    Thank you for sharing the code with the community. I will forward it to our documentation team.

    Stefani Tacheva
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered