PageManager.CreatePage questions

Posted by Community Admin on 04-Aug-2018 00:17

PageManager.CreatePage questions

All Replies

Posted by Community Admin on 05-Mar-2013 00:00

The documentation describes the following approach for creating pages (for brevity I've removed bits of code not applicable to question):

var pageDataId = Guid.NewGuid();
pageData = manager.CreatePageData(pageDataId);
pageNode = manager.CreatePage(parent, pageId, NodeType.Standard);
pageNode.Page = pageData;

However, when I decompile CreatePage, I see that pageNode.Page is internally set by calling this.CreatePageData().


1. Is there a reason that the documentation describes doing it this way rather than omitting the CreatePageData() step, and setting the properties on pageNode.Page.PageData instead after the call to CreatePage.

2. The same documentation page demonstrates setting HtmlTitle, Title, Description properties on pageData, as well as Name, Description, Title, and UrlName on pageNode. Is there are reason for the duplication of Title and Description? I'm trying to determine if there is ever a reason that I would not want to always set the properties on both objects to the same values.

3. I can't find any documentation for creating a NodeType.Group page. Would I be correct in thinking only the pageNode is created in this case, and its Page property is left as null? 

Thank you for your help!


This thread is closed