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 3504 posts 12135 karma points MVP 9x 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

Please Sign in or register to post replies

Write your reply to:

Draft