How to get the toplevel pages - General Discussions - General Discussions - Progress Community
 General Discussions

How to get the toplevel pages

  • How to get the toplevel pages
  • I want to get level-1 or toplevel pages. I plan to use sth. like "Telerik.Sitefinity.Web.BackendSiteMap.GetSiteMapProvider("rootname").RootNode; "
    One question is what the parameter "rootname" to GetSiteMapProvider actually means and how I set this argument ? I think I can use "Telerik.Sitefinity.Web.BackendSiteMap.GetCurrentProvider().RootNode; " instead.
  • Hi,

    If you want to get first level pages you can use the following source code:

    var manager = PageManager.GetManager();
    var allPages = manager.GetPageNodes().Where(pt => pt.Parent.Title == "Pages");

    It will get all pages that are on first level.

    Kind regards,
    Stefani Tacheva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • I do think so
  • That's the one worked with me 

    ParentId == SiteInitializer.CurrentFrontendRootNodeId