Skip to content

Instantly share code, notes, and snippets.

@carlosmartinezt
Last active August 29, 2015 14:00
Show Gist options
  • Save carlosmartinezt/11220673 to your computer and use it in GitHub Desktop.
Save carlosmartinezt/11220673 to your computer and use it in GitHub Desktop.
@{
varhomeNode = Model.Content.AncestorsOrSelf().First();
}
<ul class="none topmenu">
@foreach (var node in homeNode.Children.Where(n => n.GetPropertyValue("hideTopMenu") == false)) {
<li><a href="@node.Url">@node.Name</a>
@if (node.DocumentTypeAlias == "Developments" && node.Children.Any()) {
<div class="submenu">
<ul>
@foreach(var subNode in node.Children)
{
<li><a href="@subNode.Url">@subNode.Name</a></li>
}
</ul>
</div>
}
</li>
}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment