Hello,
Please take a look at the following example code which is used to set a page template for a document:
CMS.DocumentEngine.TreeNode folderNode = CMS.DocumentEngine.TreeNode.New("CMS.MenuItem", tree);
// Get the page template
PageTemplateInfo template = PageTemplateInfoProvider.GetPageTemplateInfo("cms.articlelistwithteasers");
if (template != null)
{
int templateId = template.PageTemplateId;
folderNode.DocumentPageTemplateID = templateId;
}
Best regards,
Martin Danko