I have a few multinode pickers on my site and I would like to display the contents of all of them on one page. I would rather not make 5 different XSLT files and Macros to make this work so I was trying to pass in the information as a parameter.
<xsl:template name="CarouselMultiNode">
<xsl:param name="MultiNode" />
<xsl:if test="$MultiNode/MultiNodePicker/nodeId">
<-- More Code, you don't need to see it -->
</xsl:if>
</xsl:template>
I know that the template works because if I pass in my parameter with the $currentPage/multinode arguement it works fine. Does anyone have a suggestion on how to get this to work?
If I recall, you can't pass in XML content through the Macro Parameter Syntax ( [#fieldName] ).
So, one way around this would be to adjust your MultiNodePickers to store as CSV rather than XML.
However, another idea which I think is better, is to instead pass in the Property Alias of the MNTP property to your macro, and retrieve the XML values from there. Something like this, assuming your MNTP property alias is 'pageCarouselItems':
On an unrelated note, if you haven't seen it alreayd check out Chriztian's blog post on Using the Multi-Node Tree Picker in XSLT - he has a very cool "helper" function that makes it super easy to iterate through MNTP items without needing to use umbraco.library:GetXmlNodeById. Looks like you're already on the right track using templates though.
Can I pass a MultiNode as Parameter to Macro
I have a few multinode pickers on my site and I would like to display the contents of all of them on one page. I would rather not make 5 different XSLT files and Macros to make this work so I was trying to pass in the information as a parameter.
And in the macro it starts off like so
I know that the template works because if I pass in my parameter with the $currentPage/multinode arguement it works fine. Does anyone have a suggestion on how to get this to work?
Hi,
If I recall, you can't pass in XML content through the Macro Parameter Syntax ( [#fieldName] ).
So, one way around this would be to adjust your MultiNodePickers to store as CSV rather than XML.
However, another idea which I think is better, is to instead pass in the Property Alias of the MNTP property to your macro, and retrieve the XML values from there. Something like this, assuming your MNTP property alias is 'pageCarouselItems':
Then in your macro:
On an unrelated note, if you haven't seen it alreayd check out Chriztian's blog post on Using the Multi-Node Tree Picker in XSLT - he has a very cool "helper" function that makes it super easy to iterate through MNTP items without needing to use umbraco.library:GetXmlNodeById. Looks like you're already on the right track using templates though.
Hope this helps,
Tom
Oops - I just noticed that you were using the dollar sign to get the value recursively. In this case in your XSLT you could use something like:
that works great! thank you!
is working on a reply...