Copied to clipboard

Flag this post as spam?

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


  • Nikola Romcevic 26 posts 139 karma points
    Feb 04, 2015 @ 15:24
    Nikola Romcevic
    0

    Multinode treepicker XPath query Umbraco 7.2.1

    We are creating a multilanguage site with a structure as follows:

    root
    |
    |- example.com/
    |   |- dk/
    |   |   |- Products/              // <-- DocumentType: ProductsPage
    |   |   |   |- Product Category/  // <-- DocumentType: ProductsPage
    |   |   |   |   |- Product        // <-- DocumentType: Product
    |   |   |   |   |- Product
    |   |   |   |- Product Category/
    |   |   |   |   |- Product
    |   |- de/
    |   |   |- Products/
    |   |   |   |- Product Category/
    |   |   |   |   |- Product
    |   |   |   |- Product Category/
    |   |   |   |   |- Product
    

    So the two different versions of the site can have different content (products).

    Now to the problem

    On each product there is a Multinode Treepicker where the editor can choose "Related products".
    I'd like to limit the editor to only be able to choose products corresponding to the version he is editing.

    For instance: If the editor wants to add related products to a danish product, the treepicker should only display the products under the danish "Products"-folder. And vice versa for the german version.

    How can I achieve this? Basically I want the Multinode Treepicker to start at the correct "Products"-folder.

    Cheers, Nikola

  • Nikola Romcevic 26 posts 139 karma points
    Feb 04, 2015 @ 15:45
    Nikola Romcevic
    0

    After spending an hour and a half googling and searching forums for help and finding nothing, I decided to create a new topic here.

    15 minutes later I find the solution... Typical.

    The XPath that ended up working for me was: $current/ancestor-or-self::ProductsPage

    To be honest I don't know why it's working. Even $parent/ancestor-or-self::ProductsPage seems to work.

Please Sign in or register to post replies

Write your reply to:

Draft