Copied to clipboard

Flag this post as spam?

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


  • Yaco Zaragoza 80 posts 334 karma points
    Sep 11, 2023 @ 15:09
    Yaco Zaragoza
    0

    Best way to get all the files in the same level?

    Can anyone tell me if there is snippet or an easy way to get all the links under the same parent as the page selected?

  • Huw Reddick 1749 posts 6114 karma points MVP c-trib
    Sep 12, 2023 @ 05:30
    Huw Reddick
    0

    Hi Yaco,

    What exactly do you mean by all the links?

    Are these child pages or links added by a multiUrl picker?

  • Yaco Zaragoza 80 posts 334 karma points
    Sep 12, 2023 @ 13:45
    Yaco Zaragoza
    0

    Sorry for not being clear. I mean child pages.

    I created 3 main sections and each has 3-5 child sections.

    Here is an example of what I have and what I am looking to do.

    PARENT SECTION 1

    • Child Section A1
    • Child Section A2
    • Child Section A3

    PARENT SECTION 2

    • Child Section B1
    • Child Section B2
    • Child Section B3

    PARENT SECTION 3

    • Child Section C1
    • Child Section C2
    • Child Section C3

    If the use is on Child Section B2 I want the script to return all the pages at the same level as Child Section B2

  • Marc Goodson 2142 posts 14345 karma points MVP 8x c-trib
    Sep 12, 2023 @ 21:29
    Marc Goodson
    100

    Hi Yaco

    You could use .Siblings() or .SiblingsAndSelf()

    Depending if you want to include the page you are on as well...

    The razor cheatsheet is good for discovering things like this...

    https://docs.umbraco.com/umbraco-cms/fundamentals/design/templates/razor-cheatsheet

    Regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft