Umbraco content image data type returns empty

233 views Asked by At

This macro working on localhost but doesn't work on live (img src returns empty).

When I change

<xsl:variable name="url" select="umbraco.library:GetMedia($media, 0)" />

value 0 by 1 or -1 in this row, it is working but when I published site img src it returns empty. I use content image.

<!DOCTYPE xsl:stylesheet [
  <!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
  xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" 
  xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" 
  xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" 
  xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
  xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" 
  xmlns:msxml="urn:schemas-microsoft-com:xslt" 
  xmlns:umbraco.library="urn:umbraco.library" 
  exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets"
>
  <xsl:output method="xml" omit-xml-declaration="yes" />

  <xsl:param name="currentPage" />

  <xsl:template match="/">
    <div id="slider-wrapper">
      <div id="slider" class="nivoSlider">
        <xsl:for-each select="umbraco.library:GetXmlNodeById(1102)/*[@isDoc]">
          <xsl:variable name="media" select="number(resim)" />
          <xsl:variable name="url" select="umbraco.library:GetMedia($media, 0)" />
          <img src="{$url/umbracoFile}" width="726" height="385" alt="">
            <xsl:attribute name="title">#htmlcaption<xsl:value-of select="position()" /></xsl:attribute>
          </img>
        </xsl:for-each>
      </div>
      <xsl:for-each select="umbraco.library:GetXmlNodeById(1102)/* [@isDoc]">
        <div class="nivo-html-caption">
          <xsl:attribute name="id">htmlcaption<xsl:value-of select="position()" /></xsl:attribute>
          <span class="slider_news_hdr"><xsl:value-of select="baslik" /></span>
          <span class="slider_news_text"><xsl:value-of select="aciklama" /></span>
        </div>
      </xsl:for-each>
    </div>
  </xsl:template>
</xsl:stylesheet>
0

There are 0 answers