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 88 posts 363 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 1929 posts 6717 karma points MVP 2x 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 88 posts 363 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 2157 posts 14431 karma points MVP 9x 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