i am making a website in umbraco. In this i am rendering image using umbraco.library.getMedia
method. Here i am facing a very strange behaviour of umbraco. Sometimes images get rendered and some times images do not render. I have analyzed xslt and i found that getMedia(nodeid,0)/umbracoFile
does not return any thing when i get empty image src. If i publish any node or work somewhere in umbraco and then publish site, then i may found rendered images. It means that images randomly appears and disappears.
It is totally conusing me, where is the fault. please help me.
I am posting code used to render image
<xsl:variable name="img1" select="umbraco.library:GetMedia($slideImg,'false')/umbracoFile" />
<xsl:variable name="img2" select="umbraco.library:GetMedia($slideImg,0)/umbracoFile" />
<xsl:choose>
<xsl:when test="$img1!= ''">
<img src="{$img1}" alt="" style="display: block;"
title="{umbraco.library:GetXmlNodeById(@id)/imageTitle}" description="{umbraco.library:GetXmlNodeById(@id)/description}"/>
</xsl:when>
<xsl:otherwise>
<img src="{$img2}" alt="" style="display: block;"
title="{umbraco.library:GetXmlNodeById(@id)/imageTitle}" description="{umbraco.library:GetXmlNodeById(@id)/description}"/>
</xsl:otherwise>
</xsl:choose>