Im using the multi-node picker to select images for a "slideshow" at the top of my pages.
I would like to make it so that if a page has NO images selected, the parent's images are shown. If the parent have NO images selected, the parent above... and so on.
showing media from mulit-node picker recursively
Im using the multi-node picker to select images for a "slideshow" at the top of my pages.
I would like to make it so that if a page has NO images selected, the parent's images are shown. If the parent have NO images selected, the parent above... and so on.
How do i do this with the multi node picker???
returns some images, but not just the parents images...?!?!
Hey,
As long as your MultiNodePicker property is the same name for all the nodes you can do this
<xsl:variable name="mntp_images" select="$currentPage/ancestor-or-self::* [@isDoc][string(MultiNodePicker)!=''] [position()=1]" />
This will look at the current node then up the tree to get the first value that is not empty (thanks to Doug Robar for this tip)
Rich
Thanks, but could you post the entire <xsl:for-each.... Like:
That would help me a lot ;)
My code above would only work for when uComponents is set to hold csv values
Not tested but should work
Rich
Sorry, typo above ($splitImages not $splitResults) and can't edit it
Yeah i spotted that one, but i cant get it to work anyway... Is MultiNodePicker here:
[string(MultiNodePicker)!='']
the alias on my document type? In my case called "topbilleder" . Or is it a global naming for that specifik Datatype?
- My MultiNodePicker returns XML, isnt the splitfunction unnecessary then?
That is the name of your MNTP property, so for your code
Sorry, don't know how to make this work for having MNTP set to XML and the above code won't work, so you can either change your MNTP to csv (remember to publish your nodes after the change) or adapt the above code to work with XML using the code at the bottom of this page http://ucomponents.codeplex.com/wikipage?title=MultiNodeTreePicker&referringTitle=Documentation
Rich
Think something like the below would work if it was XML.
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc][string(topbilleder)!=''] [position()=1] /topbilleder/MultiNodePicker/nodeId">
is working on a reply...