Page Ordering

Posted by Community Admin on 03-Aug-2018 14:53

Page Ordering

All Replies

Posted by Community Admin on 12-Sep-2011 00:00

Hi,

I am using the code,

var pages = App.WorkWith()
                          .Pages()
                          .Where(p => p.Parent != null)
                          .Where(p => p.Parent.Title == "Home")
                          .Where(p => p.ShowInNavigation == true)
                          .Get()
                          .ToList();

to list pages from database in Sitefinity4.1.I ordered the pages in the "Pages" page using up/down, and I want to load pages in that order .How can I make this possible ?

Posted by Community Admin on 15-Sep-2011 00:00

Hello Rakesh,

Have you tried using OrderBy:

var pages = App.WorkWith()
              .Pages()
              .Where(p => p.Parent != null)
              .Where(p => p.Parent.Title == "Home")
              .Where(p => p.ShowInNavigation == true)
              .OrderBy(p => p.Ordinal)
              .Get()
              .ToList();


Regards,
Victor Velev
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

This thread is closed