Copied to clipboard

Flag this post as spam?

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


  • Sébastien Richer 194 posts 430 karma points
    May 21, 2013 @ 21:39
    Sébastien Richer
    0

    Using multi-node tree picker with per-language start node id

    Hello,

    I have these 2 sets of categories in my site, they are part of my content tree:

    - Site
    - EN
    - Category set ABC
    - Category A
    - Category B
    - Category set XYZ
    - Category X
    - Category Y
    - FR
    - Category set ABC
    - Category A
    - Category B
    - Category set XYZ
    - Category X
    - Category Y

    I'm trying to create there "Project" documents types that allows the user to select [0...*] of these categories in two seperate fields. So I thought I would create a Multi-Node Tree Picker (MNTP), but then when I was about to set the "Start node Id" I realised that my FR projects need the FR categories and the EN projects need the EN categories.

    So other than using inherited document types, is there another smart way I could do this?

    Thanks!

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 21, 2013 @ 23:23
    Chriztian Steinmeier
    100

    Hi Sébastien,

    So where are your "Project" documents located?

    You should be able to use the "XPath Expression" option for picking a start node, e.g. if your Projects are below EN, you can say $parentPage/ancestor-or-self::AliasOfENdoctype

    - and then you can furthermore disable the "Category set" nodes from being picked...

    /Chriztian

  • Sébastien Richer 194 posts 430 karma points
    May 22, 2013 @ 16:02
    Sébastien Richer
    0

    Hi Chriztian,

    Ohh this sounds like it could work. Sadly I'm very bad with xPath, I'll need a little more help. So here is my structure, with projects and categories (with adjustment, sorry):

    - EN
    - Projects
    - ProjectA
    - ProjectB
    - Categories
    - Category set ABC
    - Category A
    - Category B
    - Category set XYZ
    - Category X
    - Category Y 

    So now I use this as the start node "ancestor-or-self::Accueil" and this in my XPath filter ("Enable" type) "/*[self::SousExpertise]". This works well, I see my whole tree from the language node. Could I drill down one from the language node to the categories node so that my content editors don'T see the whole tree?

    I tried with "$parentPage/" but that gave me an error when I tried to view the content nodes "System.Xml.XPath.XPathException: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function".

    Thanks a lot for the help!

  • Sébastien Richer 194 posts 430 karma points
    May 22, 2013 @ 16:09
    Sébastien Richer
    0

    Nevermind! I got it! Rocked XPath! :D

    ancestor-or-self::Accueil/descendant::SectionExpertise[1]

    This is great! Thank you very much Chriztian!

Please Sign in or register to post replies

Write your reply to:

Draft