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.
Copy content with children
Hello
I'm trying to copy a contentnode with it's children. I currently have something in the likes of:
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.
You can call a the method PublishWithChildren to publish the children as well.
Dave
is working on a reply...