I'm populating a blog using 2.0 beta, and have entered 10 posts so far.
On
the landing page, the posts are listed, but my understanding is that these should be in date order (most recent first) - my listings for Sep 2010 show them in the order, by post date: 27 then 30 then 19
This applies to both the main list of posts and also the latest posts summary in the right column.
In the tree structure, they seem to be ordered correctly:
Still not got this working - any chance of a pointer please Anthony? Just need to know where to add that suggested code - wherever I try, I get errors!
In 3.6.1 I didn't have nodes =((IEnumerable)posts).Take(count); but I was able to make everything sort by date by adding nodes = nodes.OrderByDescending(x => x.CreateDate).Take(count); after both instances of nodes = postList.Take(count); in uBlogsyListPosts.cshtml.
2.0 beta - posts in wrong order
I'm populating a blog using 2.0 beta, and have entered 10 posts so far.
On the landing page, the posts are listed, but my understanding is that these should be in date order (most recent first) - my listings for Sep 2010 show them in the order, by post date: 27 then 30 then 19
This applies to both the main list of posts and also the latest posts summary in the right column.
In the tree structure, they seem to be ordered correctly:
Any ideas how to correct this?
Thanks
Allan
You could add
nodes = nodes.OrderByDescending(x => x.GetProperty("uBlogsyPostDate").Value.ToString())
Sorry to ask, but where should this be added to?
Still not got this working - any chance of a pointer please Anthony? Just need to know where to add that suggested code - wherever I try, I get errors!
Thanks
Allan
Replace this line:
nodes = ((IEnumerable<DynamicNode>)CommentService.Instance.GetComments(Model.Id, true)).Take(count);
with these
nodes = ((IEnumerable<DynamicNode>)CommentService.Instance.GetComments(Model.Id, true));
nodes = nodes.OrderByDescending(x => x.GetProperty("uBlogsyPostDate").Value.ToString()).Take(count);
I don't have that first line in uBlogsyListPosts.cshtml. Am I looking in the wrong place?
I do have:
and
Sorry wrong forum post. doh!
replace
with
That's sorted it - thanks!
Actually, is it possible to sort by POST date rather than by CREATE date?
In 3.6.1 I didn't have
nodes =((IEnumerable)posts).Take(count);
but I was able to make everything sort by date by addingnodes = nodes.OrderByDescending(x => x.CreateDate).Take(count);
after both instances ofnodes = postList.Take(count);
in uBlogsyListPosts.cshtml.Thanks!
is working on a reply...