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 Guys.
First of all, thanks for this awesome community. I have a little issue, that i hope you can solve for me.
I am using the razer syntax menu like this:
@{ var selection = CurrentPage.AncestorOrSelf(2).Children;}
What i want to do, is to choose a specific sup page, and write out the menu with only the children of that sub page.
I hope someone can help.
Have a nice weekend!
Hi Asger,
For that issue you can use Content Picker property editor in backend - just for selecting needed node.
In Razor you need to iterate over child nodes of selected node.
var selectedNode = Umbraco.TypedContent('selectedId'); foreach (var childNode in selectedNode.Children) { <li> <a href="@childNode.Url">@childNode.Name</a> </li> }
Cheers, Alex
Hi Alex.
I had some problems, but i ended up solving it like this:
@{ var page = Umbraco.TypedContent(1095); } @foreach (var child in page.Children) { <li> <a href="@child.Url">@child.Name</a> </li><br/> }
Thank you for the help :)
asger storebjerg, you are welcome!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Automatic menu for children of subpage.
Hi Guys.
First of all, thanks for this awesome community. I have a little issue, that i hope you can solve for me.
I am using the razer syntax menu like this:
@{ var selection = CurrentPage.AncestorOrSelf(2).Children;}
@foreach (var item in selection) {-
@item.Name
}
What i want to do, is to choose a specific sup page, and write out the menu with only the children of that sub page.
I hope someone can help.
Have a nice weekend!
Hi Asger,
For that issue you can use Content Picker property editor in backend - just for selecting needed node.
In Razor you need to iterate over child nodes of selected node.
Cheers, Alex
Hi Alex.
I had some problems, but i ended up solving it like this:
Thank you for the help :)
asger storebjerg, you are welcome!
is working on a reply...