Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johan Möller 83 posts 137 karma points
    Mar 04, 2010 @ 11:49
    Johan Möller
    0

    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>&amp;height=50</xsl:text>

                      </xsl:attribute>

                    </img>

     

                  </xsl:for-each>

     

                </xsl:for-each> 

  • Johan Möller 83 posts 137 karma points
    Mar 04, 2010 @ 13:15
    Johan Möller
    0

    Ah solved, wasnt the xslt >_< 

Please Sign in or register to post replies

Write your reply to:

Draft