Copied to clipboard

Flag this post as spam?

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


  • Psib3r 70 posts 119 karma points
    Sep 05, 2012 @ 10:06
    Psib3r
    0

    List of pages

    I have this code, yet nothing is displaying, am I making a stupid mistake somewhere?  I just want to iterate through the entire site.

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @
      var homeNode Model.AncestorOrSelf("HomePage");
      if (homeNode!= null{
        <ul>
        @foreach (var item in homeNode.Children{
          <li>
            <a href="@item.Url">@item.Name</a>
          </li>
          }
        </ul>
      }
    }

  • gilad 185 posts 425 karma points
    Sep 05, 2012 @ 10:41
    gilad
    0

    Hii Psib3r

    "HomePage" is your node name? or document type alias?

    It should be your home page document type alias.

     

  • Psib3r 70 posts 119 karma points
    Sep 05, 2012 @ 11:44
    Psib3r
    0

    Oh dear, it helps to add the bodyText tag!

  • 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