Copied to clipboard

Flag this post as spam?

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


  • Anders Dahl Tollestrup 73 posts 52 karma points
    Jan 15, 2011 @ 18:54
    Anders Dahl Tollestrup
    0

    List folder images

    Hi

    In the old schema I was used to use following code to list images:

    <div id="galleryThumbnails">
            <ul>
                <xsl:if test="string($currentPage/data [@alias='pAlbumFolder']) != ''">
                    <xsl:for-each select="umbraco.library:GetMedia($currentPage/data [@alias='pAlbumFolder'], 'true')/node">
                        <li>
                            <a href="{umbraco.library:NiceUrl($currentPage/@id)}?picture={./@id}" title="Vis billede">
                                <img width="120px" height="90px">
                                    <xsl:attribute name="src"><xsl:value-of select="./data [@alias='umbracoFile']" /></xsl:attribute>
                                    <xsl:attribute name="alt"><xsl:value-of select="./@nodeName" /></xsl:attribute>
                                </img>
                            </a>
                            <br />
                            <xsl:value-of select="./@nodeName" />
                        </li>
                    </xsl:for-each>
                </xsl:if>
            </ul>
        </div>

    But this (of cause) don't work in umbraco 4.6.1 with the new schema. What changes are needed to make this work ?

  • Anders Dahl Tollestrup 73 posts 52 karma points
    Jan 15, 2011 @ 19:10
    Anders Dahl Tollestrup
    1

    Solved it myself :-)

    The scouting way - Learning by doing ....

    <div id="galleryThumbnails">
        <ul>
          <xsl:if test="string($currentPage/galleryFolder) != ''">
            <xsl:for-each select="umbraco.library:GetMedia($currentPage/galleryFolder, 'true')/*">
              <li>
                <a href="#" title="Vis billede">
                  <img width="120px" height="90px">
                    <xsl:attribute name="src"><xsl:value-of select="./umbracoFile" /></xsl:attribute>
                    <xsl:attribute name="alt"><xsl:value-of select="./@nodeName" /></xsl:attribute>
                  </img>
                </a>
                <br />
                <xsl:value-of select="./@nodeName" />
              </li>
            </xsl:for-each>
          </xsl:if>
        </ul>
      </div>


Please Sign in or register to post replies

Write your reply to:

Draft