xpath for selecting published child nodes for MNTP
I'm using the multi-node tree picker and want to limit the nodes that can be selected to the direct child nodes of type DestinationPage of the currently edited page. But I can't seem to work out the xpath expression / filter to do that.
I have the xpath expression set to self::* to select the current page as the start node. And this is my path filter /* [self::DestinationPage]
How can I change the filter to only allow the direct children of the current page to be selected.
The filter is evaluated on a single XML node - so it doesn't have any context, which means you cannot use any of the surrounding nodes to validate the filter...
Maybe they're all on the same level? Then you could use /*[self::DestinationPage][@level = 3] ?
I suppose it's not a huge issue if I cant filter the pages shown anymore. I was just trying to limit what pages were pickable as I know the client will pick one at too deep a level and complain when it doesn't work (no matter how many times we explain how it works to them).
Yeah, but it ought to be be possible to do a little filtering, at least just by comparing with $currentPage (or even just $currentPage's Id) - there's an issue in the tracker that you could go vote for here: issues.umbraco.org/issue/U4-3275
Even if we just had a $currentPageId "magic" variable, you could do this:
xpath for selecting published child nodes for MNTP
I'm using the multi-node tree picker and want to limit the nodes that can be selected to the direct child nodes of type DestinationPage of the currently edited page. But I can't seem to work out the xpath expression / filter to do that.
I have the xpath expression set to
self::*
to select the current page as the start node. And this is my path filter/* [self::DestinationPage]
How can I change the filter to only allow the direct children of the current page to be selected.
Hi suzyb,
The filter is evaluated on a single XML node - so it doesn't have any context, which means you cannot use any of the surrounding nodes to validate the filter...
Maybe they're all on the same level? Then you could use
/*[self::DestinationPage][@level = 3]
?/Chriztian
ah I see.
I suppose it's not a huge issue if I cant filter the pages shown anymore. I was just trying to limit what pages were pickable as I know the client will pick one at too deep a level and complain when it doesn't work (no matter how many times we explain how it works to them).
Yeah, but it ought to be be possible to do a little filtering, at least just by comparing with $currentPage (or even just $currentPage's Id) - there's an issue in the tracker that you could go vote for here: issues.umbraco.org/issue/U4-3275
Even if we just had a $currentPageId "magic" variable, you could do this:
So it would be nice to be able to have that...
/Chriztian
is working on a reply...