这个宏在localhost上工作但在live上不起作用(img src返回空)。
当我改变
<xsl:variable name="url" select="umbraco.library:GetMedia($media, 0)" />
这一行中的0乘1或-1,它正在工作但是当我发布网站img src时它返回空。我使用内容图片。
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<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>