Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

DynamicNodeWalker Problems

$
0
0

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


Viewing all articles
Browse latest Browse all 72689


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>