Hi Yakov
Thanks for your reply, but it didn't work.
This is my code now
@foreach(var item in Model.Children().Where(x=>x.ContentType.Alias== "blog").OrderBy(x=>x.CreateDate).Take(5)){
and it gives me this error:
"Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type"
Does that meas anything for you. I haven't worked with Umbraco for a long time, so I apologize for my stupid questions :-)
Show a list of the 5 latest post in a blog
Hi
I'm trying to make a list of the 5 most recent blog posts, but can't make it work. Hope you can help :-)
My structur under "Content" is this:
The above code does not work on the "Blog" page. Can you guys help me with that? And I would like if it only showed the top 5 latest posts ;-)
something like that
Hi Yakov Thanks for your reply, but it didn't work.
This is my code now
and it gives me this error: "Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type"
Does that meas anything for you. I haven't worked with Umbraco for a long time, so I apologize for my stupid questions :-)
Hi again
I made it work this way, but don't know if it's good code. What is your opinion?
This is good, but it take 5 ordered by sort field. if you need the latest blog I guess newest, you should orderby date
What version of it is Umbraco 7 or 8?
Yes, you are right and it works perfectly. Thanks for your help :-)
is working on a reply...