Copied to clipboard

Flag this post as spam?

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


  • Inmedia 124 posts 176 karma points
    Apr 29, 2012 @ 10:35
    Inmedia
    0

    listing number of items

    I am trying to create a list of items, that will only list a specific number of items per page. I have created this XSLT for the purpose:

     

    <xsl:param name="currentPage"/>

    <xsl:variable name="itemsPerPage" select="5"/>
    <xsl:variable name="numberOfItems" select="count($currentPage/* [@isDoc and string(umbracoNaviHide) != '1'])"/>
    <xsl:variable name="pageNumber">  
      <xsl:choose>
          <xsl:when test="umbraco.library:RequestQueryString('page') = ''">
            <xsl:value-of select="1"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="umbraco.library:RequestQueryString('page')"/>
        </xsl:otherwise>  
      </xsl:choose>  
    </xsl:variable>   
         
    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul class="albums">

      <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
      <xsl:if test="position() &gt; $itemsPerPage * number($pageNumber -1) and
        position() &lt;= number($itemsPerPage * number($pageNumber -1) * $itemsPerPage)">
        <li>
          <a class="fancybox" data-fancybox-group="group" href="{fullSize}">
            <xsl:attribute name="data-fancybox-group"><xsl:value-of select="$currentPage/@nodeName"/></xsl:attribute>
            <img class="vintage" src="/images/vintage.png"/>
            <img src="{thumbnail}"/>
          </a>
        
        </li>
      </xsl:if>

    </xsl:for-each>
      
    </ul>

     

    But I doesn't seem to work... I am using Umbraco 4.7. Is it a scheme problem or?

    Can anyone tell me what I am doing wrong?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies