Copied to clipboard

Flag this post as spam?

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


  • Daniel Pazos 12 posts 123 karma points
    Mar 08, 2021 @ 18:58
    Daniel Pazos
    0

    Get sibling nodes from custom controller

    Hi,

    If I want to get all the nodes filtered by his alias I can do that in my page using

    var roots= Model.Root().Siblings().Where(x => x.ContentType.Alias == "aliasToLookFor");
    

    But how can I do the same from a custom RenderMvcController?

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Mar 08, 2021 @ 19:09
    Alex Skrypnyk
    101

    Hi Daniel

    var roots = Umbraco.AssignedContentItem.Root().Siblings().Where(x => x.ContentType.Alias == "aliasToLookFor");
    

    Thanks,

    Alex

  • Daniel Pazos 12 posts 123 karma points
    Mar 09, 2021 @ 09:39
    Daniel Pazos
    1

    Thank you, Alex. You saved my day :D

  • 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