umbraco macro XSLT not working -
i image folder parameter (folder present in media section) macro in umbraco , loop through images. first thing check folder not empty , during loop further try check if image name equal "marhall_spadayhpbanner_jul131%20(4).jpg" need put different link anchor. have tried following xslt code reason not working expected , second condition (when image equal 'media/42595/marhall_spadayhpbanner_jul131%20(4).jpg' ) never true.
any ideas thanks
<xsl:for-each select="$imagefoldercontents/node [@nodetypealias='image']"> <xsl:if test="string(current()/data [@alias='umbracofile']) != ''"> <a href="www.somelink.com"> <img alt="{current()/@nodename}"> <xsl:attribute name="src"><xsl:value-of select="current()/data [@alias='umbracofile']"/></xsl:attribute> </img> </a> </xsl:if> <xsl:if test="string(current()/data [@alias='umbracofile']) = 'media/42595/marhall_spadayhpbanner_jul131%20(4).jpg'"> <a href="someotherlink.com"> <img alt="{current()/@nodename}"> <xsl:attribute name="src"><xsl:value-of select="current()/data [@alias='umbracofile']"/></xsl:attribute> </img> </a> </xsl:if> </xsl:for-each>
the output code
<div style="clear: both; position: relative; height: auto;" class="slideshow innerfade"><a href="http://gifts.skchase.com/marhall/summerspa/" style="z-index: 5; position: absolute; display: none;"><img alt="dont fool" src="/media/42595/marhall_spadayhpbanner_jul131 (4).jpg"></a><a href="https://gifts.skchase.com/marhall/summerspa/" style="z-index: 4; position: absolute; display: block;"><img alt="dont fool" src="/media/42595/marhall_spadayhpbanner_jul131 (4).jpg"></a><a href="http://gifts.skchase.com/marhall/summerspa/" style="z-index: 3; position: absolute; display: none;"><img alt="mh-ext-16-hero.jpg" src="/media/1548/mh-ext-16-hero.jpg"></a><a href="http://gifts.skchase.com/marhall/summerspa/" style="z-index: 2; position: absolute; display: none;"><img alt="golf_hero_arial_new.jpg" src="/media/1816/golf_hero_arial_new.jpg"></a><a href="http://gifts.skchase.com/marhall/summerspa/" style="z-index: 1; position: absolute; display: none;"><img alt="mh-spa-e-25-hero.jpg" src="/media/1552/mh-spa-e-25-hero.jpg"></a></div>
replace %20 in if statement space. should fix it.
Comments
Post a Comment