1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Page Ordering

Page Ordering

2 posts, 0 answered
  1. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    12 Sep 2011
    Link to this post
    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 ?
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    15 Sep 2011
    Link to this post
    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
2 posts, 0 answered