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
I'm trying to create a navigation razor script that will show all children to the current page. No problem there... but if I'm at a node that is on level 3 (or above) I have to show the the children of the parent level 2 node.
Is this possible?
Hi,
You can do something like this:
var startNode = Model.AncestorOrSelf(2); // Get the current node if it's level 2, otherwise walk up and get the first level 2 node foreach (var node in startNode.Children) { <li><a href="@node.url">@node.Name</a></li> }
HTH,Tom
That worked just perfectly! Thanks alot Tom... must have been tired last night... :o)
/Michael
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Show nodes at specific level
I'm trying to create a navigation razor script that will show all children to the current page. No problem there... but if I'm at a node that is on level 3 (or above) I have to show the the children of the parent level 2 node.
Is this possible?
Hi,
You can do something like this:
HTH,
Tom
That worked just perfectly! Thanks alot Tom... must have been tired last night... :o)
/Michael
is working on a reply...