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
Hi
I try to list the top(1) of my navigation - but somthing is not right?
Please some ideas ?
Hi there,
Try:
var root = CurrentPage.AncestorOrSelf(1);
This will find the first node of level 1 up the tree which will be either "DK" or "EN" depending on the node being rendered.
Jeavon
Try this
var root = Model.AncestorOrSelf(1).Descendants("docType").Items;
@Fuji, this is a MVC query not DynamicNode, check the first line PartialViewMacroPage :-)
PartialViewMacroPage
I tell you what, it would be great if every post had the @inherits line so it's easy to tell if it's MVC/IPublishedContent or DynamicNode :-)
@inherits
Many thanks for the reply. I was almost there. ;-)
By the way, when I've got an answer is there anything I need to do to finish the question?
Great!
Looks like you found the green tick already which is "mark this reply as the solution"
Yes thank you so much ;-)
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.
Continue discussion
Navigation with Razor
Hi
I try to list the top(1) of my navigation - but somthing is not right?
Please some ideas ?
Hi there,
Try:
This will find the first node of level 1 up the tree which will be either "DK" or "EN" depending on the node being rendered.
Jeavon
Try this
@Fuji, this is a MVC query not DynamicNode, check the first line
PartialViewMacroPage
:-)I tell you what, it would be great if every post had the
@inherits
line so it's easy to tell if it's MVC/IPublishedContent or DynamicNode :-)Many thanks for the reply. I was almost there. ;-)
By the way, when I've got an answer is there anything I need to do to finish the question?
Great!
Looks like you found the green tick already which is "mark this reply as the solution"
Yes thank you so much ;-)
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.