Hi, I want to move a page type under another one. So I tried to change the parent Link as:
productPageType.ParentLink = pageType.ContentLink.ToPageReference();
The problem is after running the script, I see my page was not moved.
Can you help me?
ServiceLocator.Current.GetInstance<IContentRepository>().Move(sourceRef, targetRef, ..)
Great this work.
I have another question, if possible to set the position/order where the item should be moved in the hieraquicy?
As far as I remember (no compilation done):
var repo = ServiceLocator.Current.GetInstance<IContentRepository>();
var newVersion = page.CreateWritableClone();
newVersion.Property[MetaDataProperties.PagePeerOrder].Value = defaultSortOrder;
aaaand.... `ServiceLocator` is BAD! :)
use proper dependency injection.