Copied to clipboard

Flag this post as spam?

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


  • Benoit 14 posts 34 karma points
    Jan 08, 2013 @ 10:03
    Benoit
    0

    Selection problem in Multi-Node Tree Picker

    Hi all,

     

    we created a multi-language project in Umbraco 4.9. For every language section, the homepage should have different navigation sections and items. For this purpose we created a DataType we called Multilist and it is based on the Multi-Node Tree Picker. It displays all nodes starting from the language-root.

    This is how the selection looks

    EN-US
    About
    Catalogue
    Item 1
    Item 2
    FAQ

    All looks fine, and everything is nicely selectable, except for the EN-US node.

    The xpath expression used is

    $currentPage/ancestor-or-self::*[1]

    I tried several options, but they all create the same problem. Every single node can be picked (regardless of the level ) except for the root. 

    If this list is displayed, 'Catalogue' cannot be picked, all the others can.

    Catalogue
    Item 1
    Item 2

    What are we doing wrong?

    regards

    Benoit

     

     

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jan 08, 2013 @ 12:32
    Chriztian Steinmeier
    0

    Hi Benoit,

    Are you using the XPath in enable mode to allow nodes?

    The XPath you've supplied will select only the first ancestor (i.e. the parent) of $currentPage.

    If you want to be able to select any node in the current node's language tree, try this:

    $parentPage/ancestor-or-self::*[@level >= 1]/descendant-or-self::*[@isDoc]

    (If your EN-US node is not at level 1, change the number accordingly)

    Using $parentPage makes it possible for the picker to work even on a non-published page (e.g. if you've just created the page and haven't saved it yet).

    /Chriztian

  • Benoit 14 posts 34 karma points
    Jan 08, 2013 @ 14:22
    Benoit
    0

    Hello Chriztian,

    switching between enable and disable mode for XPath did not change anything. So i left it in disable mode.

    Changed the xpath statement to your suggestion though. Thx for that.

    Still cannot select the top node in my tree.

    regards

     

    Benoit

     

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jan 08, 2013 @ 14:32
    Chriztian Steinmeier
    0

    Hi again,

    I updated the XPath to use descendant-or-self:: instead of the descendant:: shortcut (//)

    If you're using this XPath the filter should be set to enable for you to be able to actually select the nodes.

    Hope it helps,

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft