More in this section

Forums / Developing with Sitefinity / PageManager.CreatePage questions

PageManager.CreatePage questions

1 posts, 0 answered
  1. Gary
    Gary avatar
    91 posts
    Registered:
    19 Jul 2007
    05 Mar 2013
    Link to this post

    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;
    manager.SaveChanges();

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

    Questions:

    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!

    Gary

1 posts, 0 answered