I really hope someone can help me. Im trying to create a submenu.(i’ve used the snippet)
But i cannot seem to get the descentants in de sub list of the menu. Can someone please tell me how i can do that.
Thanks,
Jaco
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@*
This snippet displays a list of links of the pages immediately under the top-most page in the content tree.
This is the home page for a standard website.
It also highlights the current active page/section in the navigation with the css class “current”.
*@
@{ var selection = CurrentPage.Site().Children.Where(“Visible”); }
-
@foreach (var item in selection)
{
if (item.Name == "Rondvaarten"){
- @item.Name
}
else {
<li class="@(item.IsAncestorOrSelf(CurrentPage) ? "menu" : "menu")">
<a href="@item.Url">@item.Name</a>
</li>
}
}
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/77271-adding-submenu-in-my-navigation