Copied to clipboard

Flag this post as spam?

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


  • Thomas Won Nyheim 33 posts 145 karma points
    Jul 04, 2019 @ 09:05
    Thomas Won Nyheim
    0

    Xpath relative to current hostname

    I've been looking at improving the user experience for the editors of some of our multi-sites. And specifically to lessen the need for editors to navigate when looking for certain items in the multi node content picker.

    Fetching the data node with xpath usually works out just fine when I only have one site to worry about, however when using it with multi site my query "$root//ProductPage" will always find the first "ProductPage" even if it's located in the "wrong" site.

    The site tree looks like this.

    Site 1
     - ProductPage1
    SIte 2
     - ProductPage2
    Shared Data
     - Products
    

    The content picker is located in a document type under Shared Data/Products, so I cannot relate it to the $site selector.

    Any ideas if this is even possible or a direction I should be looking?

  • Søren Kottal 713 posts 4571 karma points MVP 6x c-trib
    Jul 08, 2019 @ 13:46
    Søren Kottal
    0

    Hi Thomas

    Theres a $site variable you can use too, so you should be able to get the right product page by setting the query to $site//ProductPage.

  • Thomas Won Nyheim 33 posts 145 karma points
    Jul 09, 2019 @ 16:44
    Thomas Won Nyheim
    0

    Thank you for your reply Søren, but wouldn't this just grab the root node of the current node? So if the content picker exists in my shared folder it would only look in the shared folder?

Please Sign in or register to post replies

Write your reply to:

Draft