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?
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...
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".
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!
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
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!
Nevermind! I got it! Rocked XPath! :D
ancestor-or-self::Accueil/descendant::SectionExpertise[1]
This is great! Thank you very much Chriztian!
is working on a reply...