Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rocoeh 65 posts 86 karma points
    Jun 21, 2012 @ 13:44
    Rocoeh
    0

    get all children of current node

    get the error

     

    Error loading MacroEngine script (file: )

     

    my code....

    <umbraco:Macro runat="server" language="cshtml">
      @using umbraco.MacroEngines;
      @{
     
      <ul>
        @foreach(var item in DynamicModel.Children){
            <li>@item.Name</li>
        }
    </ul>
      
      }
    </umbraco:Macro>

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 21, 2012 @ 13:57
    Fuji Kusaka
    0

    Hi Rocoeh,

    You could do something like this 

     

    @{          
    var sortedList = Model.Children.OrderBy("createDate descending"); 
                foreach(var page in  sortedList){             
    <li><a href="@page.Url">@page.Name</a></li> 
            }      
    }

    Hope it helps

    //fuji

  • Rodion Novoselov 694 posts 859 karma points
    Jun 21, 2012 @ 13:58
    Rodion Novoselov
    0

    Hi. Just replace "DynamicModel" to "Model".

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies