Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 16, 2013 @ 15:35
    Fuji Kusaka
    0

    Displaying subContent depending on CurrentNode within a loop

    Hi Guys,

    I have some issues on a sub Navigation which lies within another loop. The idea here is to display sub Content of the current page when user click on the url to access the page.

    Here is my code any idea how to get this working ?

    var  sub  = @Model.AncestorOrSelf(3).Children.Where("Visible");
    @foreach(dynamic i in sub){ string subUrl = (i.Children.Where("Visible").Count() >0)? i.Children.First().Url: i.Url;
    <li class='@Library.If(i.IsAncestorOrSelf(Model), "current","")'><a href="@Library.If(i.HasValue("sicomExternalLink"), i.sicomExternalLink, @subUrl)" target="@Library.If(i.Where("externalUrl") && i.HasValue("sicomExternalLink"), "_blank","_self")">@i.Name</a>
    @if(Model.Children.Count()>0){ foreach(dynamic j in i.Children){ @j.Name } } </li> }

     

     

Please Sign in or register to post replies

Write your reply to:

Draft