Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Good Afternoon,
I'm trying to put together a simple sub-navigation menu, that will display
<nav> <ul id="subNavigation"> @if(Model.Children.Where("Template != 0").Where("Visible").Count() > 0) { foreach(var page in Model.Children.Where("Template != 0").Where("Visible")) { var selected = page.Id == Model.Id ? " selected" : ""; <li class="[email protected](selected)"><a href="@page.Url">@page.Name</a></li> } } </ul></nav>
Hi Hefin,
You could try do something like
var parent = Model.AncestorOrSelf(3); // 3 is the Level from the Content Section that is -- Towards Zero , -- Reducing Landfill etc
@if(parent !=null){ foreach(var page in parent.Children.Where("umbracoNaviHide != true")){ var selected = page.IsAncestorOrSelf(Model)? "class=selected": ""; <li @selected><a href="@page.Url">@page.Name</a></li> }}
Hope it helps
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Simple Sub Navigation Script
Good Afternoon,
I'm trying to put together a simple sub-navigation menu, that will display
Hi Hefin,
You could try do something like
var parent = Model.AncestorOrSelf(3); // 3 is the Level from the Content Section that is -- Towards Zero , -- Reducing Landfill etc
Hope it helps
is working on a reply...