Copied to clipboard

Flag this post as spam?

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


  • Frost 5 posts 25 karma points
    Sep 19, 2011 @ 11:15
    Frost
    0

    show all the media folders as gallery

    Hello, what im trying to do is show all my set/folder of images on a single page.

    Used the xlst below and the media picker in document type.

    Currently i can show only one set/folder of images on my page.

    What i really want is show all the set/folders on one single page.

    Can i do that? Can anyone give a tip? Many thanks.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" 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.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
      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:variable name="mediaFolderId" select="number($currentPage/mediaFolderId)" />
        <xsl:variable name="thumbWidth" select="number(67)" />
        <xsl:variable name="thumbHeight" select="number(67)" />

        <xsl:template match="/">
            <!-- Displays all images from a folder in the Media Library -->
            <xsl:if test="number($mediaFolderId)">
                <ul id="gallery">
                    <xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image">
                        <xsl:if test="umbracoFile !=''">
                            <li>
                                <href="{umbracoFile}" title="{@nodeName}" rel="gallery">
                                    <img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&amp;width={$thumbWidth}&amp;height={$thumbHeight}" width="{$thumbWidth}" height="{$thumbHeight}" alt="{@nodeName}" title="{@nodeName}" class="thumbnail" />
                                </a>
                            </li>
                        </xsl:if>
                    </xsl:for-each>
                </ul>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>
  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Sep 19, 2011 @ 11:28
    Jeroen Breuer
    0

    Hello,

    Do you want to show the content of a folder because you want to create a gallery? If so you could also have a look at the Digibiz Advanced Media Picker. Have a look at this video: http://www.screenr.com/TEY. It's very easy to create a gallery with it.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft