I am trying to make a navigation bar. My folder structure is as followed:
This is what I have right now:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<div class="well well-lg span-padding extra-padding top background-light">
<div>
<ul class="nav nav-list tree">
@{
var documentRootNodeId = Model.Content.GetPropertyValue("documentRoot", true); // Fetch recursive document root id.
var selection = Umbraco.TypedContent(documentRootNodeId).Children.Where("Visible"); // Select all nodes below the document root.
}
@foreach(var item in Model.Content.Descendants("menu")){
foreach (var Menus in @item.Descendants("menuItem")){
<li class="MenuItems">@Menus.Name</li>
foreach (var MenuItems in @Menus.Children){
if(MenuItems.GetPropertyValue("hoofdstukIcoon") != "") {
<li><a href="@MenuItems.Url"><i class="fa fa-@(MenuItems.GetPropertyValue("hoofdstukIcoon")) fa-fw"></i> @MenuItems.Name</a></li>
}else {
<li><a href="@MenuItems.Url">@MenuItems.Name</a></li>
var childIsActive = false;
foreach(var sub in @MenuItems.Children){
if (CurrentPage.Url == sub.Url) {
childIsActive = true;
}
<ul class="nav subnav nav-list tree @(childIsActive ? "" : "collapse")">
@foreach(var sub2 in @MenuItems.Children){
<li @(CurrentPage.Url == sub.Url ? "class=active" : "")>
<a onclick="parent.resizeParent();" href="@sub.Url">@(sub.GetPropertyValue("hoofdstukMenuTitel") != "" ? sub.GetPropertyValue("hoofdstukMenuTitel") : sub.GetPropertyValue("hoofdstukTitel"))</a>
</li>
}
</ul>
}
}
}
}
}
</ul>
</div>
</div>
Everything is displaying correctly till I try to navigate to the page, it removes the navigation bar. As far as I am aware the bottom bit (starting at ChildisActive) should make it so the navigation bar stays.
Navigation bar dissapears
Hey,
I am trying to make a navigation bar. My folder structure is as followed:
This is what I have right now:
Everything is displaying correctly till I try to navigate to the page, it removes the navigation bar. As far as I am aware the bottom bit (starting at ChildisActive) should make it so the navigation bar stays.
Hey
Looks for any descendants of the current page of alias 'menu', I suspect you want to do your searches from the website node.
Cheers
Cheers! Any way I can create a dropdown for a structure like this:
Help item 3 should be a dropdown in the menu.
is working on a reply...