Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicolas 4 posts 35 karma points
    Apr 23, 2015 @ 14:37
    Nicolas
    0

    Copy content with children

    Hello

    I'm trying to copy a contentnode with it's children. I currently have something in the likes of:

    var orderContent = ApplicationContext.Services.ContentService.GetById(int.Parse(orderId));
    var copyOrderContent = ApplicationContext.Services.ContentService.Copy(orderContent, orderContent.ParentId, true, 0);

    But this only copies the node itself without children (which I think is logical). What I could do is loop over the children and then add them manually but I wondered if there was something out of the box to do this.

    Thanks in advance

    Edit: Seems as the children are also copied, but not published.

  • Dave Woestenborghs 3325 posts 11170 karma points MVP 5x admin c-trib
    Apr 24, 2015 @ 12:03
    Dave Woestenborghs
    100

    You can call a the method PublishWithChildren to publish the children as well.

    Dave

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies