Copied to clipboard

Flag this post as spam?

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


  • Dimitris Chrysomallis 23 posts 137 karma points
    Nov 10, 2017 @ 11:04
    Dimitris Chrysomallis
    0

    Using the Multinode Tree Picker in a multilingual setting

    We have built a one-to-one multilingual site. That is, there is an EN root folder and a GR sibling:

    - En
    - Gr
    

    A document type includes a tree picker property (e.g. Speakers). The picker data type requires that we define the content root. However, I have two roots, one for each language.

    As a result, I am forced to only select content from one language.

    Vorto package, provides a language menu in the content editor. However, it does not seem to affect the above behavior.

    Have you ever had to handle this case? If so how would you suggest that we go around it?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Nov 10, 2017 @ 11:41
    Dan Diplo
    100

    You need to use an XPath query in your MNTP rather than picking a content page. So in the data type click "Query for Root Node" and then add an XPath query there. Without knowing your tree structure and doctype aliases it's hard to help with the query, but the MNTP does provide helper.

    Example: I have an installation with multiple blogs in multiple sites. Each blog can contain many Blog Posts. I have an MNTP picker on a Blog Post that allows an editor to select related Blog Posts from the current Blog. So the XPath for this is:

    $current/ancestor-or-self::Blog
    

    Allow items of type: BlogPost

    The query basically goes back up the tree from the current node to find the root Blog node of the site and then allows only BlogPost nodes to be selected from within it.

  • Dimitris Chrysomallis 23 posts 137 karma points
    Nov 10, 2017 @ 12:57
    Dimitris Chrysomallis
    0

    Well, that was something I had not noticed.

    I tend to display xpath blindness.

    Thank you.

Please Sign in or register to post replies

Write your reply to:

Draft