Navigation with sub navigation, only show current node's subnav or current Nodes parent subnav
I have my navigation buile and have a question about navigation with subnav and showing only the current nodes subnav IF the current node is selected AND if the current node is a subpage of the node with the subnav. Currently my navigation is showing ALL subnav if I am on a node with sub navigation in it. I only need to show the current nodes subnav or if it current node is a child of the main nav node with the subnav then I need to also show its siblings nav.
This is what I have so far. There is a small thing I am missing and I can't figure out what it is.
Navigation with sub navigation, only show current node's subnav or current Nodes parent subnav
I have my navigation buile and have a question about navigation with subnav and showing only the current nodes subnav IF the current node is selected AND if the current node is a subpage of the node with the subnav. Currently my navigation is showing ALL subnav if I am on a node with sub navigation in it. I only need to show the current nodes subnav or if it current node is a child of the main nav node with the subnav then I need to also show its siblings nav.
This is what I have so far. There is a small thing I am missing and I can't figure out what it is.
I found my issue.
For my else if statement it should look like this
else if(page.Id == Model.Parent.Id){ <ul> @foreach(var childPage in @Model.Parent.Children.Where("Visible && NodeTypeAlias == \"MinisitePage\"")){ <li><a href="@childPage.Url" class="@Library.If(childPage.Id == Model.Id, "subSelected", "")"> @childPage.Name</a></li> } </ul> }
Hi Carlos,
Try this one instead.
Hope this helps,
/Dennis
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.