Hello!
I'm having trouble accessing child nodes inside a foreach. I'll start by providing the content structure:
root
blog
blogpost1
block1
block2
...
blogpost2
block1
block2
...
...
I'm on the blog page and I want to display, for each blogpost, the title (property of blogpost) and the property text of the first block.
Right now I have this, and it works:
<umbraco:Macro runat="server" language="cshtml">
@foreach (var item in @Model.BlogPost.Where("Visible"))
{
@item.blogPostTitle;
}
</umbraco:Macro>
But when I try to go further down the tree, like so:
<umbraco:Macro runat="server" language="cshtml">
@foreach (var item in @Model.BlogPost.Where("Visible"))
{
@item.blogPostTitle;
@item.Down(2).text
}
</umbraco:Macro>
I always get the Error loading MacroEngine script (file: )
I probably can't do the @item.Down(2).text and I don't know how to do it properly.
Can anyone shed some light ?
Thanks