Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Having looked through the forum for the possible solution to my problem, but no luck.
Faily simple xslt file that should display a image selected with 'Improved Mediapicker';
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1' and @template = '1053']"><xsl:variable name="catImage" select="data[@alias='catImage']" /><xsl:choose> <xsl:when test="$catImage != ''"> <img src="{umbraco.library:GetMedia($catImage, 'false')/data [@alias = 'umbracoFile']}" /> </xsl:when> <xsl:otherwise> <img src="/images/no_image.gif" alt="{@nodeName}" /> </xsl:otherwise></xsl:choose></xsl:for-each>
No errors in the editor when saving but the output is failing with; Error parsing XSLT file: \xslt\ProductList.xsl
Any ideas what i am doing wrong?
Hi Dinovo
Try to cast the $catImage to a number in the call to GetMedia:
<img src="{umbraco.library:GetMedia(number($catImage), 'false')/data [@alias = 'umbracoFile']}" />
The reason it doesn't fail in the editor is probably because it ends up in the "otherwise" branch.
/Chriztian
Hi Chriztian
This fails;
This works;
<img src="{umbraco.library:GetMedia(number(1116), 'false')/data [@alias = 'umbracoFile']}" />
Haveing some trouble seeing whats going on there. :-/
Hi Dinovo,
It might sound like I've been pimping one of my blog posts quite a lot today ... but take a quick read, it should give you some insight into using GetMedia in XSLT.
http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/
Cheers, Lee.
Hi Lee,
Thank you very much - that did the trick :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
New getmedia problem?
Having looked through the forum for the possible solution to my problem, but no luck.
Faily simple xslt file that should display a image selected with 'Improved Mediapicker';
No errors in the editor when saving but the output is failing with; Error parsing XSLT file: \xslt\ProductList.xsl
Any ideas what i am doing wrong?
Hi Dinovo
Try to cast the $catImage to a number in the call to GetMedia:
The reason it doesn't fail in the editor is probably because it ends up in the "otherwise" branch.
/Chriztian
Hi Chriztian
This fails;
This works;
Haveing some trouble seeing whats going on there. :-/
Hi Dinovo,
It might sound like I've been pimping one of my blog posts quite a lot today ... but take a quick read, it should give you some insight into using GetMedia in XSLT.
http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/
Cheers, Lee.
Hi Lee,
Thank you very much - that did the trick :)
is working on a reply...