Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello
when on a product page I'm trying to loop thrue a mediafolders nodes then print out the images that got products id tagged on it.
I am succesfully looping thrue the files but when looping the tages im only able to get out the first image that has the products tag.
heres the xslt:
<xsl:variable name="prodId" select="$currentPage/@id "/>
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia(1167, 1)" />
<div id="slide" class="small_slider_short">
<div class="scrollable">
<a class="prevPage browse left"></a>
<div class="items">
<xsl:for-each select="$mediaNode/node">
<xsl:variable name="prodTags" select="data[@alias='prodTags']" />
<xsl:variable name="tagArray" select="umbraco.library:Split($prodTags, ',')" />
<xsl:variable name="filename" select="data[@alias='umbracoFile']" />
<xsl:for-each select="$tagArray/value [$prodId = .]">
<img>
<xsl:attribute name="src">
<xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>&height=50</xsl:text>
</xsl:attribute>
</img>
</xsl:for-each>
Ah solved, wasnt the xslt >_<
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Printing media with the correct tag
Hello
when on a product page I'm trying to loop thrue a mediafolders nodes then print out the images that got products id tagged on it.
I am succesfully looping thrue the files but when looping the tages im only able to get out the first image that has the products tag.
heres the xslt:
<xsl:variable name="prodId" select="$currentPage/@id "/>
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia(1167, 1)" />
<div id="slide" class="small_slider_short">
<div class="scrollable">
<a class="prevPage browse left"></a>
<div class="items">
<xsl:for-each select="$mediaNode/node">
<xsl:variable name="prodTags" select="data[@alias='prodTags']" />
<xsl:variable name="tagArray" select="umbraco.library:Split($prodTags, ',')" />
<xsl:variable name="filename" select="data[@alias='umbracoFile']" />
<xsl:for-each select="$tagArray/value [$prodId = .]">
<img>
<xsl:attribute name="src">
<xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>&height=50</xsl:text>
</xsl:attribute>
</img>
</xsl:for-each>
</xsl:for-each>
Ah solved, wasnt the xslt >_<
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.