Created
June 3, 2014 13:17
-
-
Save carlosmartinezt/c0bddcd6c2704f67cdc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits Umbraco.Web.Macros.PartialViewMacroPage | |
@{ | |
var home = Model.Content.AncestorsOrSelf().First(); | |
} | |
@helper Traverse(IPublishedContent node, int pad) | |
{ | |
<li> | |
<a href="@node.Url">@(!String.IsNullOrWhiteSpace(node.GetPropertyValue<string>("pageName")) ? node.GetPropertyValue<string>("pageName") : !String.IsNullOrWhiteSpace(node.GetPropertyValue<string>("pageTitle")) ? node.GetPropertyValue<string>("pageTitle") : node.Name)</a> | |
@if (node.Children.Any(n => n.TemplateId > 0 )) | |
{ | |
<ul class="disc"> | |
@foreach (var n in node.Children.Where(n => n.TemplateId > 0 && !n.GetPropertyValue<bool>("hideFromSitemap"))) | |
{ | |
@Traverse(n, pad + 8) | |
} | |
</ul> | |
} | |
</li> | |
} | |
<ul class="disc"> | |
@Traverse(home, 0) | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment