Copied to clipboard

Flag this post as spam?

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


  • syn-rg 282 posts 425 karma points
    Jul 20, 2011 @ 09:23
    syn-rg
    0

    Image gallery navigation - Display how many images per album

    I have an image gallery that has many different albums, that include all the images.
    Each album contains a different amount of images.

    I would like my navigation to display the total number of images for that album.

    For example my navigation would like this:
    Bicycle (Image Gallery Photo) - 63
    (number of images)
    --- Helmet (Image Gallery Album) - 20
    ------- Helmet image (Image Gallery Photo)
    --- Jersey - 30
    --- Shoes - 13
    Football - 96
    --- Balls - 22
    --- Goals - 34
    --- Players - 40

    The doctype for the Image Gallery is called: nitroGallery
    The docytpe for the Image Gallery Album is called: nitroGalleryAlbum
    The doctype for the Image Gallery Photo is called: nitroGalleryPhoto

    Can anyone suggest how I can achieve this in my navigation?
    I think I it's just a matter of getting the total number of child nodes that have that doctype (nitroGalleryPhoto).

    Thanks in advance,
    JV

     

    Here's my XSLT:

    <?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"
    exclude-result-prefixes="msxml umbraco.library">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:template match="/">

    <h6>
    <xsl:value-of select="$currentPage/ancestor-or-self::node [@level=3]/@nodeName"/>
    </h6>

    <div id="Level2Nav">
    <ul id="qm0" class="qmmc">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=3]"/>
    </xsl:call-template>
    </ul>
    </div>
    <script type="text/javascript">qm_create(0,true,0,0,'all',false,false,false,false);</script>
    </xsl:template>


    <xsl:template name="drawNodes">
    <xsl:param name="parent"/>

    <xsl:for-each select="$parent/node [string(data [@alias='sideMenu']) = '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true())]">
    <li>
    <xsl:if test="count(./node [string(./data [@alias='sideMenu']) = '1']) = 0">
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
    </xsl:attribute>
    <xsl:value-of select="@nodeName"/>
    </a>
    </xsl:if>
    <xsl:if test="count(./node [string(./data [@alias='sideMenu']) = '1']) &gt; 0">
    <a>
    <xsl:attribute name="class">qmparent</xsl:attribute>
    <xsl:if test="$currentPage/ancestor-or-self::node/@id = @id">
    <xsl:attribute name="class">qmactive qmpersistent</xsl:attribute>
    </xsl:if>
    <xsl:attribute name="href">
    <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
    </xsl:attribute>
    <xsl:value-of select="@nodeName"/>
    </a>
    <ul>
    <xsl:choose>
    <xsl:when test="./data [@alias = 'umbracoNaviHide'] != '1'">
    <li>
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
    </xsl:attribute>
    <xsl:value-of select="@nodeName"/>
    </a>
    </li>
    </xsl:when>
    </xsl:choose>
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="."/>
    </xsl:call-template>
    </ul>
    </xsl:if>


    </li>
    </xsl:for-each>
    </xsl:template>


    </xsl:stylesheet>
Please Sign in or register to post replies

Write your reply to:

Draft