Skip to content

Instantly share code, notes, and snippets.

@sebastiandammark
Last active October 13, 2017 08:46
Show Gist options
  • Save sebastiandammark/17ffbd72d74ea8cfde08c0e246b5da7d to your computer and use it in GitHub Desktop.
Save sebastiandammark/17ffbd72d74ea8cfde08c0e246b5da7d to your computer and use it in GitHub Desktop.
umbraco stuff
@{
var sections = Model.Content.Sections.Select(x => new Subpagesection(x));
<ul class="Navigation-sub">
@foreach(Subpagesection subsection in sections) {
<li data-subbav-dropdown-toggle>@subsection.Header
<div class="Navigation-subsub">
<div class="Separator"><div class="Separator-mask"></div></div>
@if(subsection.HasValue("Pickedpages")) {
var subpageCollection = subsection.GetPropertyValue<IEnumerable<IPublishedContent>>("Pickedpages");
<ul>
@foreach(var subpage in subpageCollection) {
var page = Umbraco.TypedContent(subpage.Id);
if (subpage.DocumentTypeAlias == "Event") {
@Eventlink(page)
} else {
@Subpagelink(page)
}
}
</ul>
<div class="Separator"><div class="Separator-mask"></div></div>
}
</div>
</li>
}
</ul>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment