I have been reading through a lot of posts but I haven't been able to solve my problem. What I want to do is simple, I want to display a preview of all the blog posts from newer to older. I am able to get all the posts and display them but I can't get them in the order I want. This is my razor script file:
I have tried changing to OrderBy("CreateDate, asc") but nothing changes. I have read that some people use the following syntax: OrderBy("CreateDate desc") but if I change it to that it will give an error and not load.
I have also tried OrderByDescending(x => x.CreateDate); but it does not load as well.
Can someone help?
For the record, I'm using umbraco v 4.11.3 (Assembly version: 1.0.4760.34993)
Problems with OrderBy
Hello.
I have been reading through a lot of posts but I haven't been able to solve my problem. What I want to do is simple, I want to display a preview of all the blog posts from newer to older. I am able to get all the posts and display them but I can't get them in the order I want. This is my razor script file:
I have tried changing to OrderBy("CreateDate, asc") but nothing changes. I have read that some people use the following syntax: OrderBy("CreateDate desc") but if I change it to that it will give an error and not load.
I have also tried OrderByDescending(x => x.CreateDate); but it does not load as well.
Can someone help?
For the record, I'm using umbraco v 4.11.3 (Assembly version: 1.0.4760.34993)
Hi Joao,
I just tried the below and it worked fine (v6.1.1):
Could you try that, if you still get an error we will need to know what it says?
Thanks,
Jeavon
Ok i feel kinda dumb right now... I just tried it and worked but I could swear it didn't before! Thank you for such a quick reply Jeavon!
Np, glad it's sorted!
is working on a reply...