Move document

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

Moving a document

 

[C#]

 

// Tree provider

CMS.TreeEngine.TreeProvider provider = new CMS.TreeEngine.TreeProvider(CMS.CMSHelper.CMSContext.CurrentUser);

 

// Get document (node) which will be moved

CMS.TreeEngine.TreeNode node = provider.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentSiteName, "/Products/PDAs/ItemA", "en-us");

 

// Get target node under which the document will be moved

CMS.TreeEngine.TreeNode target = provider.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentSiteName, "/Products/Notebooks", "en-us");

         

if ((target != null) && (node != null))

{

  // Move the document under the specified target

  provider.MoveNode(node, target.NodeID);

}

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?move_document.htm