I'm using the multi-node tree picker to do an image gallery and I have a problem getting this code to work:
<xsl:template match="/">
<!-- uComponents: Multi-node Tree Picker - An XSLT example ===================================== The Multi-node Tree Picker data-type will provide XML data based on the nodes you have selected. In this example, the property alias name for the Multi-node Tree Picker is "treePicker". -->
<!-- First we check that the Multi-node Tree Picker has any nodeId values --> <xsl:if test="$currentPage/images/MultiNodePicker/nodeId">
On the page {$media/umbracoFile} is displayed exactly as it appears in the XSLT macro file.
Ultimately I will be using ImageGen and putting the first ten images returned into an unordered list with all images also be saved in a JavaScript array - that part'll be easy once I can get {$media/umbracoFile} to work.
I've not looked at DAMP mostly because I think it said somewhere that it hadn't been tested with 4.7?
I'm more than happy with the way MNTP works, I just don't understand why I'm not getting any value returned from "{media/umbracoFile}"
Is there a problem with the XML, the XSLT, my understanding of how it should work or something else? I'm editing the file in Web Matrix, saving it then refreshing the page served from IIS7.5. I also have VS 2010 available if that would help.
Using the following code I can print out the XML which appears to have all the data I need, I just can't use it!
Ohh Chris, I can see that I forgot the dollar sign in front of media in my snippet. Cound you try the snippet i provided but with a $ in front of media? :)
Problem with Multi-node Tree Picker
I'm new Umbraco and XSLT so please be gentle.
I'm using the multi-node tree picker to do an image gallery and I have a problem getting this code to work:
<xsl:template match="/">
<!--
uComponents: Multi-node Tree Picker - An XSLT example
=====================================
The Multi-node Tree Picker data-type will provide XML data based on the nodes you have selected.
In this example, the property alias name for the Multi-node Tree Picker is "treePicker".
-->
<!-- First we check that the Multi-node Tree Picker has any nodeId values -->
<xsl:if test="$currentPage/images/MultiNodePicker/nodeId">
<xsl:for-each select="$currentPage/images/MultiNodePicker/nodeId">
<xsl:copy-of select="umbraco.library:GetMedia(., 0)" /><br />
<xsl:variable name="media" select="umbraco.library:GetMedia(., false())" />
{$media/umbracoFile}
<br />
</xsl:for-each>
</xsl:if>
</xsl:template>
The copy of select writes out the following relevant XML:
<Image id="1115" version="f41046c2-2153-479e-af1e-3de363232017" parentID="1113" level="2" writerID="0" nodeType="1032" template="0" sortOrder="2" createDate="2011-05-03T22:35:29" updateDate="2011-05-03T22:35:29" nodeName="Product01L.jpg" urlName="product01l.jpg" writerName="Chris" nodeTypeAlias="Image" path="-1,1113,1115"><umbracoFile>/media/641/Product01L.jpg</umbracoFile>
<umbracoWidth>720</umbracoWidth>
<umbracoHeight>1000</umbracoHeight>
<umbracoBytes>104998</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension></Image>
On the page {$media/umbracoFile} is displayed exactly as it appears in the XSLT macro file.
Ultimately I will be using ImageGen and putting the first ten images returned into an unordered list with all images also be saved in a JavaScript array - that part'll be easy once I can get {$media/umbracoFile} to work.
Thanks
Chris
Hi Chris
You need to wrap the small snippet in am img-tag like this:
I hope the above code makes sense :)
/Kim A
Hi Kim,
I tried that but only got:
<img src="" alt="" />
What else should I try?
Thanks
Chris
Hello,
Did you also have a look at the Digibiz Advanced Media Picker? You can do the same thing as with MNTP, but it has more options. Here is a quick video on how to use it: http://www.screenr.com/TEY
Jeroen
I've not looked at DAMP mostly because I think it said somewhere that it hadn't been tested with 4.7?
I'm more than happy with the way MNTP works, I just don't understand why I'm not getting any value returned from "{media/umbracoFile}"
Is there a problem with the XML, the XSLT, my understanding of how it should work or something else? I'm editing the file in Web Matrix, saving it then refreshing the page served from IIS7.5. I also have VS 2010 available if that would help.
Using the following code I can print out the XML which appears to have all the data I need, I just can't use it!
Thanks
Chris
Ohh Chris, I can see that I forgot the dollar sign in front of media in my snippet. Cound you try the snippet i provided but with a $ in front of media? :)
/Kim A
Hi Kim,
Thanks, that fixed it.
LOL looking at all the examples I can see the dollar sign everywhere, just not in my XSLT!
Thanks :o)
Chris
Edit: Deleted my reply, as I was too slow! ;-)
is working on a reply...