Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johan 95 posts 264 karma points
    Nov 27, 2015 @ 09:44
    Johan
    0

    Creating a sibling menu

    I want a sibling menu like this:

    enter image description here enter image description here

    As you can see I want the menu to the left to remain after choosing a sibling node like that. How can I achieve that?

  • Luke 110 posts 256 karma points
    Nov 27, 2015 @ 09:48
    Luke
    1

    Hi,

    To get the siblings I normally go up to the parent and then call the children.

    var p = CurrentPage.Parent;
    var siblings = p.Children;
    

    Regards, L

  • Johan 95 posts 264 karma points
    Nov 27, 2015 @ 10:02
    Johan
    0

    And how can I display it in a list?

  • Luke 110 posts 256 karma points
    Nov 27, 2015 @ 10:08
    Luke
    100
    <ul>
    @foreach(var sibling in siblings)
    {
    <li><a href="@sibling.Url">@sibling.Name</a></li>
    }
    </ul>
    

    Regards, L

  • Johan 95 posts 264 karma points
    Nov 27, 2015 @ 10:15
    Johan
    0

    Thank you sooo much!!! <3

  • 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.

Please Sign in or register to post replies