foreach (var post in Model.Children<PostModel>())
{
if(post.GetProperty("featuredPost").Value.ToString() == "false")
{
<h1 class="post-title"><a href="@post.Url">Featured Post</a></h1>
}
-- More code
}
Alright so, I have the code above (using Articulate) and I have an Umbraco property called featuredPost on every post. I am trying to get the value and if it is true I want it to show on the post that has that value set to true.
I've been trying it that way but it is not working, I checked the name of the property and it seems fine, I might be wrong on the if using "post" as the variable.
GetProperty won't return value.
Alright so, I have the code above (using Articulate) and I have an Umbraco property called featuredPost on every post. I am trying to get the value and if it is true I want it to show on the post that has that value set to true.
I've been trying it that way but it is not working, I checked the name of the property and it seems fine, I might be wrong on the if using "post" as the variable.
Any suggestion?
Managed to make it work by using GetProperty like that, not sure if that's the best approach but it is working as intended right now.
is working on a reply...