Copied to clipboard

Flag this post as spam?

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


  • RunnicFusion 62 posts 145 karma points
    Feb 28, 2014 @ 09:44
    RunnicFusion
    0

    Xpath filtering MultiNodeTreePicker

    For a project (running Umbraco 7.0.3) I want to use xPath to get the right folders pack.

    What i am trying to do:

    - Root
    -- slider 1
    --- slider item 1a
    --- slider item 2a
    -- slider 2
    --- slider item 1b
    --- slider item 1b

    At the Root I have a MultiNodeTreePicker datatype that picks the sliders (slider 1 or slider 2) document alias from the pages under the Root page. But It give's a empty tree and no errors.

    My XPath:

    $current/FotoFolder

    When searching online I get something like (see below), but this kind of xPath is not working in Umbraco 7

    $ancestorOrSelf/ancestor-or-self::*[@level=1]/NewsItem

    Hope someone know's how to deal with this, thanks!

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 06, 2014 @ 10:39
    Anthony Dang
    104

    I think you need //

    $current//FotoFolder

    I do this for ublogsy:

    $current/ancestor-or-self::uBlogsyLanding//uBlogsyContainerAuthor

    This looks up the tree until it finds uBlogsyLanding, then it looks down from there to find uBlogsyContainerAuthor

    Probably overkill for you. Sorry, my xpath isnt the best.

     

  • Denis 25 posts 267 karma points
    Oct 05, 2016 @ 12:22
    Denis
    0

    Hi, Anthony! Do you know will this work with entityResource.searchAll method from Umbraco Belle API?

    Thanks.

  • RunnicFusion 62 posts 145 karma points
    Mar 06, 2014 @ 12:22
    RunnicFusion
    0

    thanks, i've got it working yesterday, the same way as you suggest.

    the xPatch is only the start root, with the filter option underneath you can filter the document types of this startnode you want to be displayed.

Please Sign in or register to post replies

Write your reply to:

Draft