Is there any way to make a multi node picker content aware?
We have two websites (home nodes) with shared functionality. But we have two document types for each of the detail pages on each website because their content might be different. Now we have shared components, but some of there components have a multi node picker which picks those detail pages. Still following along?
We have website Foo, and Bar.
Foo
-- FooNewsDetailPage
-- FooBlogDetailPage
Bar
-- BarNewsDetailPage
-- BarBlogDetailPage
XComponent
-- Multi Node Picker
Now when I add the page component (element) to any of the pages, I want the multi node picker to be "context aware". When it is placed under Foo, it can only select the Foo type of pages. When it is placed under Bar it can only select the Bar detail pages.
Right now the only solution I see is creating two components, which have the same backing code. But for the CMS are two different document types. FooXComponent which has the Foo document types in the multi node picker. And the same thing for Bar.
But I am wondering if I can just keep the generic XComponent.
I'm not sure if you can limit it completely. But, on a Multi Node Tree Picker, you can use XPath to set a start location. If you use $site it starts at the root node of your site, in your example I think it would start at either Foo / Bar respectively.
However, I don't know if that will stop you picking pages from the other sites or not, I've never tested it from that perspective.
It should, however, take into account user permissions so if they cannot access Site Bar, they shouldn't be able to pick anything from it.
Context aware property editors?
Is there any way to make a multi node picker content aware?
We have two websites (home nodes) with shared functionality. But we have two document types for each of the detail pages on each website because their content might be different. Now we have shared components, but some of there components have a multi node picker which picks those detail pages. Still following along?
We have website Foo, and Bar.
Now when I add the page component (element) to any of the pages, I want the multi node picker to be "context aware". When it is placed under Foo, it can only select the Foo type of pages. When it is placed under Bar it can only select the Bar detail pages.
Right now the only solution I see is creating two components, which have the same backing code. But for the CMS are two different document types. FooXComponent which has the Foo document types in the multi node picker. And the same thing for Bar.
But I am wondering if I can just keep the generic XComponent.
Hey Roy
I'm not sure if you can limit it completely. But, on a Multi Node Tree Picker, you can use XPath to set a start location. If you use
$site
it starts at the root node of your site, in your example I think it would start at either Foo / Bar respectively.However, I don't know if that will stop you picking pages from the other sites or not, I've never tested it from that perspective.
It should, however, take into account user permissions so if they cannot access Site Bar, they shouldn't be able to pick anything from it.
Thanks
Nik
Hey Nik,
That doesn't seem to work. I've never worked with XPath before, but I see that it might be a solution.
Do you know if I can go all the way up until I reach the first home page?
Our structure looks like this
Where both inherit from
BaseHomePage
. Is there a query that can do that? Or maybe go up until it reaches a node that inherits fromBaseHomePage
For anyone in the future. This XPath query worked for me:
is working on a reply...