Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robin Nicholl 137 posts 277 karma points
    Feb 02, 2012 @ 02:17
    Robin Nicholl
    0

    OrderBy SortOrder - uBlogsy

    I'm trying to display my posts by sort order – ie in the order that they appear in the Content tree. The posts are grouped under year and month nodes, eg:

    -2011
    -November
      -Post_1 -December -Post_2 -2012 -January -Post_4 -Post_3

    … and that's how I want them to display: Post_1, Post_2, Post_4, Post_3 (so that I can control the display order by sorting the nodes). But when I use this:

    nodes NodeHelper.GetPosts(tagcategoryauthorsearchTermpostList).Take(count).ToList();
    nodes = nodes.OrderBy(x=>x.SortOrder);

    … the order appears totally random.

    Any ideas?

     

  • Rodion Novoselov 694 posts 859 karma points
    Feb 02, 2012 @ 14:05
    Rodion Novoselov
    0

    Hi. As I understand, the SortOrder is sequential only within the context of the parent node. So then in your case Post_4 will be definitely less then Post_3, but Post_1 or Post_2 could be greater then Post_4.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies