I am pretty new to umbraco so bare with me. I am trying to get my submenu to function correctly. My code below is the whole menu, but my submenu part pulls all nodes from lvl2. So not just the nodes under About or under services for example.
Trying to just get a main navigation with a submenu. Thank for the assistance here. Again sorry still pretty new with umbraco.
<div id="desktop-nav">
<ul id="d-list">
<li class="d-parent" ng-repeat="item in navItems">
@{
var selection = Model.Content.Site().Children().Where(x => x.IsVisible());
}
<ul>
@foreach(var item in selection){
<li class="d-parent" ng-repeat="item in navItems">
<div class="d-name-wrapper">
<h3>@item.Name</h3>
</div>
<!-- Sub Navigation Start -->
<ul class="d-children under" ng-if="item.children">
@foreach(var subitem in Model.Content.DescendantsOrSelf().Where("Visible").Where("level > 2"))
{
<li ng-repeat="child in item.children"><a href="@subitem.Url">@subitem.Name</a></li>
}
</ul>
</li>
}
</ul>
</li>
</ul><!-- end of d-list -->
</div>
Umbraco V7 - Razor - Submenu issues
I am pretty new to umbraco so bare with me. I am trying to get my submenu to function correctly. My code below is the whole menu, but my submenu part pulls all nodes from lvl2. So not just the nodes under About or under services for example.
Trying to just get a main navigation with a submenu. Thank for the assistance here. Again sorry still pretty new with umbraco.
HI Michael
I think you just need to tweak your inner foreach loop, so you are iterating over the 'children' of the current item in the outer for each loop...
try replacing:
with
that should write out only the lv2 children of each lv1 item, underneath that particular lv1 item...
unless of totally misunderstood what you are trying to do!
regards
Marc
@marc, thank you so much bud. That is all it was. WOW just needed that extra set of eyes and expertise. THANK YOU. We can close this ticket.
is working on a reply...