I'm trying to fetch images from blogposts and and put the lates images on my startpage. I'm using umbraco 4.6.1 and I have some problems regarding GetMedia. here is the code:
the value of mymediapicker is for ex 1093 and there is no problem to print that. When I use mymediapicker in GetMedia I get an xslt error on page. If I replace $mymediapicker with my id 1093 everytihing works fine.
Get media problem
hi
I'm trying to fetch images from blogposts and and put the lates images on my startpage. I'm using umbraco 4.6.1 and I have some problems regarding GetMedia. here is the code:
<xsl:variable name="mymediapicker">
<xsl:value-of select="./data [@alias='mymediapicker']"/>
</xsl:variable>
<xsl:variable name="media" select="umbraco.library:GetMedia($mymediapicker, 0)" />
<xsl:if test="$media">
<img src="{$media/umbracoFile}" alt="{$media/altText}" />
</xsl:if>
the value of mymediapicker is for ex 1093 and there is no problem to print that. When I use mymediapicker in GetMedia I get an xslt error on page.
If I replace $mymediapicker with my id 1093 everytihing works fine.
Why canĀ“t I put $mymediapicker in GetMedia?
You have to check either mymediapicker contains value or not.
thats the core issue. When I print out $mymediapicker I do get results but when I use it the GetMedia an xslt error occur on the page...
You can get more details from here http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/
Thanks
thanks!
here is my solution...
please feel free to comment
is working on a reply...