Gallery preview function

Hullo,

I’ve created an image gallery feature. It works as intended. So far so good.

I’m currently working on a gallery list feature, where all galleries are listed. The idea is to have the gallery’s title, a link to the gallery itself, and the first three images appear in the list.

The three images is what’s causing me some headaches. I’m quite simply not able to get it to work. I’ve tried a few things, but no luck so far.

Any pointers as to how to get it to work are much appreciated.

The code sample is for the gallery itself.

<xsl:variable name="mediaFolderId" select="number($currentPage/mediaFolderId)"/>
<xsl:variable name="galleryTitle" select="$currentPage/galleryName"/>
<xsl:variable name="galleryDescription" select="$currentPage/galleryDescription"/>
<xsl:template match="/">
<xsl:if test="number($mediaFolderId)">
	<h3><xsl:value-of select="$galleryTitle"/></h3>
	<xsl:value-of select="$galleryDescription"/>
	<div class="galleryContainer">
		<ul id="gallery" class=" gallery nolist">
			<xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image">
				<xsl:if test="umbracoFile !=''">
					<li>
						<a href="{umbracoFile}" data-featherlight="">
							<img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&amp;width=150" />
						</a>
					</li>
				</xsl:if>
			</xsl:for-each>
		</ul>
	</div>
</xsl:if>

</xsl:template>


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/74128-gallery-preview-function