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
    Feb 15, 2012 @ 12:58
    Fuji Kusaka
    0

    List SubPages from Folder

    Hi All,

    Am trying to replicate a sub navigation from xslt to razor. What am trying to achieve here is to list all subpages from a specific node just as would an xslt from changeable source do.

    So far here is my razor snippets but am getting the source url as well.

    <ul>

      @{
       var subNode = Model.NodeById(1111);
       const string selectedClass = " class=\"current\"";
        bool hasSubNav = true;  
      }

      <li><a href="@subNode.Url">@subNode.Name</a></li>
      @foreach(var page in subNode.Children.Where("Visible"))
      {
       
         <li@Library.If(page.IsAncestorOrSelf(Model), selectedClass)>
             <a href="@page.Url" title="@page.Name">@page.Name</a>   
       </li>
     
     }

    </ul>
  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 15, 2012 @ 13:24
    Fuji Kusaka
    0

    OOOPS....My mistake!!!!!

    Forgot to remove this line while checking...

     

    <li><ahref="@subNode.Url">@subNode.Name</a></li>
Please Sign in or register to post replies

Write your reply to:

Draft