Thank you David, I tried it but unfortunately it didn't create the staging task.
using (new CMS.Base.CMSActionContext() { LogSynchronization = true })
{
//your code
CMS.DocumentEngine.TreeNode page = new DocumentQuery<CMS.DocumentEngine.TreeNode>()
.Path("/Meetings/SharePoint-events/Event-TEST-03", PathTypeEnum.Single)
.OnSite("MySite")
.Culture("en-us")
.TopN(1)
.FirstOrDefault();
page.DocumentName = "Updated meeting name";
page.SetValue("EventTitle", "Updated article title in English V4");
// Updates the page in the database
page.Update();
}
I have tried some code from K12.
For getting the page, I used:
var page= DocumentHelper.GetDocuments()
.Path("/Meetings/SharePoint-events/Event-TEST-03", PathTypeEnum.Single)
.Culture("en-US")
.OnCurrentSite()
.TopN(1)
.FirstOrDefault();
In that case, when I update the page, even without using the DocumentSynchronizationHelper.LogDocumentChange
, the staging task is created.
So it looks like DocumentHelper.GetDocuments()
takes care of the staging while DocumentQuery<CMS.DocumentEngine.TreeNode>()
does not... Does it make sense? DocumentQuery<CMS.DocumentEngine.TreeNode>()
is used everywhere in the API documentation while DocumentHelper.GetDocuments()
is not and is only available in k12 documentation.
I am confused, as they are so many ways of accessible the pages (DocumentHelper.GetDocuments()
, DocumentQuery<CMS.DocumentEngine.TreeNode>()
, tree.SelectNodes()
) and it is unclear to me whcih one should be used in which situation (performance, workflow, staging)...