Can't use IPublishedContent as this is for published content (shown on the front), you need to use the services api to change node's location in the tree.
Thanks for quick reply, and great info.
This helped :)
var service = ApplicationContext.Services.ContentService; // calling service
var target = service.GetById(1102); //getting target node
service.Move(target, 1108); // moving page
Move page node via API?
Hi guys,
Was wondering if it is possible to move the Node from one node to another?
I tried asigning another parent to my Umbraco.Core.Models.IPublishedContent.
But it says IPublishedContent.Parent cannot be asigned -- it is read only.
Or am I trying to do this in the wrong way? :)
/Dmitrij
Hi Dmitrij,
Can't use IPublishedContent as this is for published content (shown on the front), you need to use the services api to change node's location in the tree.
See docs here: https://our.umbraco.org/documentation/reference/management/services/contentservice
Look for Move() method overloads to accomplish what you want
Cheers, Dirk
Hi Dirk,
Thanks for quick reply, and great info. This helped :)
is working on a reply...