Copied to clipboard

Flag this post as spam?

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


  • Chris 34 posts 134 karma points
    Jul 28, 2015 @ 15:44
    Chris
    0

    MultiNodeTreePicker Siblings XPath

    I'm using v7.2.8 and I want to have a new data type to choose direct siblings of a content item. I'm using the MultiNodeTreePicker and I'm trying multiple combinations of XPath to achieve this but nothing seems to work.

    Has anyone managed to achieve this using the new placeholder values such as $parent and $current?

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jul 28, 2015 @ 20:17
    Chriztian Steinmeier
    0

    Hi Chris,

    Which specific XPath expressions did you try? If $parent works as advertised, this should do the trick:

    $parent/*[@isDoc]

    It might not be an issue, but because of the way the XML cache works, you can only pick published content using XPath.

    Hope that helps,

    /Chriztian

  • Chris 34 posts 134 karma points
    Jul 29, 2015 @ 08:07
    Chris
    0

    Hi Chriztian,

    This is an example of the structure we have:

    • Case Study 1
      • Child Content item
      • Child content item 2
    • Case Study 2
    • Case Study 3

    I've added the MultiNodeTreePicker with the XPath to the Case Study document type.

    Using $parent/*[@isDoc] gets the direct children of the Case Study, so Child Content 1 and 2.

    Using just $parent gets all the Case Studies, but also all the Child Content items as well. It looks like the $parent translates to a descendants XPath query. I can just limit my MultiNodeTreePicker to include specific Doc Types, although i was hoping to find a generic way of finding siblings so i can use this elsewhere in the site.

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jul 29, 2015 @ 09:52
    Chriztian Steinmeier
    0

    Hi Chris,

    I can recall that there's actually some bugginess with this (see this other thread about it)

    Also, it seems like you want to specify which nodes you're able to pick with the MNTP, whereas what the XPath is (supposed to be) used for is selecting a start node... doesn't fix your problem, though :(

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft