Try Now
More in this section

Forums / General Discussions / How to get the toplevel pages

How to get the toplevel pages

4 posts, 0 answered
  1. Yinfang
    Yinfang avatar
    9 posts
    07 May 2012
    04 Oct 2012
    Link to this post
    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.
  2. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    19 Oct 2016
    09 Oct 2012
    Link to this post

    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
  3. Jack
    Jack avatar
    1 posts
    02 Aug 2012
    10 Oct 2012 in reply to Stefani Tacheva
    Link to this post
    I do think so
  4. Bishoy
    Bishoy avatar
    27 posts
    15 Aug 2013
    15 Mar 2015
    Link to this post

    That's the one worked with me 

    ParentId == SiteInitializer.CurrentFrontendRootNodeId

4 posts, 0 answered