Is it possible to have an Umbraco property called 'featured' and then show these posts first in the List page?
For example I've been trying to make this work:
@if (!Model.Children.Any())
{
<article>No blog posts found</article>
}
else
{
foreach (var post in Model.Children<PostModel>())
{
@if (post.GetPropertyValue<bool>("featuredPost", true))
{
}
}
The main idea is to have a section of featured posts and after those posts comes the rest.
With that code I've noticed that the post I want to be featured does have the class applied to it but apparently they posts are shown by date and as a test I created the featured one first, so it is shown at the end of my list and not the top.
Show featured posts first.
Is it possible to have an Umbraco property called 'featured' and then show these posts first in the List page?
For example I've been trying to make this work:
The main idea is to have a section of featured posts and after those posts comes the rest.
With that code I've noticed that the post I want to be featured does have the class applied to it but apparently they posts are shown by date and as a test I created the featured one first, so it is shown at the end of my list and not the top.
Any way to make this work?
Hi Daniel
Try to use this code:
Hi Daniel
Did you solve this issue? Can we help you?
Alex
is working on a reply...