Document Page Template ID Programmatically

Chaudhary Zulfiqar asked on November 24, 2015 00:12

Hi, How do we get/set "[DocumentPageTemplateID]" while creating/importing the pages/nodes programmatically, by default it is null.

Thank you

Correct Answer

Dawid Jachnik answered on November 24, 2015 09:14


you just need to assing it by id of page template, simple example:

var node = TreeNode.New("namespace.class", treeProvider)
var pageTemplateInfo = CMS.PortalEngine.PageTemplateInfoProvider.GetPageTemplateInfo("TempletaCodeName");
node.DocumentPageTemplateID = pageTemplateInfo.PageTemplateId;
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.