Copied to clipboard

Flag this post as spam?

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


  • suzyb 474 posts 932 karma points
    Nov 05, 2013 @ 12:00
    suzyb
    0

    xpath for selecting published child nodes for MNTP

    I'm using the multi-node tree picker and want to limit the nodes that can be selected to the direct child nodes of type DestinationPage of the currently edited page. But I can't seem to work out the xpath expression / filter to do that.

    I have the xpath expression set to self::* to select the current page as the start node. And this is my path filter /* [self::DestinationPage]

    How can I change the filter to only allow the direct children of the current page to be selected.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 05, 2013 @ 13:03
    Chriztian Steinmeier
    0

    Hi suzyb,

    The filter is evaluated on a single XML node - so it doesn't have any context, which means you cannot use any of the surrounding nodes to validate the filter...

    Maybe they're all on the same level? Then you could use /*[self::DestinationPage][@level = 3] ?

    /Chriztian

  • suzyb 474 posts 932 karma points
    Nov 05, 2013 @ 14:48
    suzyb
    0

    ah I see.

    I suppose it's not a huge issue if I cant filter the pages shown anymore. I was just trying to limit what pages were pickable as I know the client will pick one at too deep a level and complain when it doesn't work (no matter how many times we explain how it works to them).

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 05, 2013 @ 14:56
    Chriztian Steinmeier
    0

    Yeah, but it ought to be be possible to do a little filtering, at least just by comparing with $currentPage (or even just $currentPage's Id) - there's an issue in the tracker that you could go vote for here: issues.umbraco.org/issue/U4-3275

    Even if we just had a $currentPageId "magic" variable, you could do this:

    //*[self::DestinationPage][@parentID = $currentPageId]
    

    So it would be nice to be able to have that...

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft