How to get the toplevel pages

Posted by Community Admin on 03-Aug-2018 17:52

How to get the toplevel pages

All Replies

Posted by Community Admin on 04-Oct-2012 00:00

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.

Posted by Community Admin on 09-Oct-2012 00:00

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

Posted by Community Admin on 10-Oct-2012 00:00

I do think so

Posted by Community Admin on 15-Mar-2015 00:00

That's the one worked with me 

ParentId == SiteInitializer.CurrentFrontendRootNodeId

This thread is closed