Help featuring an image gallery on the website

Hi guys,
Im a little rusty and need some help please…

I have an image gallery that uses the umbGallery.

Basically, I have a check box (websiteFeatured) that is on the gallery document type.
If the user selects this, I want that gallery featured in the foot of the website on each page.

The structure in the content is:

  • Homepage
    • Gallery
      • A Gallery Name (project 1 for example)
        • Gallery Image
        • Gallery Image
        • Gallery Image
      • Another Gallery Name (project 2 for example)
        • Gallery Image
        • Gallery Image
        • Gallery Image

    So if the user checks the box (websiteFeatured) on project 1, the images of that project will be displayed throughout the site.
    Also, ideally the images could be displayed in random order but only show 3 at a time.

    I was thinking something like this:

    <xsl:param name="currentPage"/>
    	<xsl:variable name="maxItems" select="3"/>	
    
    <xsl:template match="/">
    
    <xsl:variable name="galleryNode" select="$currentPage/ancestor-or-self::*/child::*[@level=2]"/>
    
    <xsl:for-each select="$galleryNode/child::umbGalleryAlbum">
    
    <xsl:if test="websiteFeatured != ''">
    	<xsl:if test="position() &lt;= $maxItems">
    
    	<img src="{$umbracoMediaFile/umbracoFile}" width="257" height="176" alt="Featured Image"/>
    	
    
    		</xsl:if>
    </xsl:if>
    </xsl:for-each>
    
    
    </xsl:template>
    

    Now I know this code is incorrect but I hope it gives an idea of what i’m trying to acheive.

    Any help would be greatly appreciated!

    thanks!


    This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/67688-help-featuring-an-image-gallery-on-the-website