Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Apr 28, 2010 @ 12:50
    trfletch
    1

    Add pagination to search results XSLT

    Hi,

    I have created the following XSLT to display search results from a form that contains two drop down boxes but I want the results to have paging. I have added paging to other pages in XSLT but my search results XSLT contains 4 different "When" statements and I want to try and not repeat the code as much as possible and make sure it is efficient so I am wondering how I go about doing this because each "When" statement would surely need a different "numberofrecords" variable and "count"  parameter in the pagination XSLT? Can anyone offer me any suggestions or am I just going to have to repeat the pagination XSLT 4 times in my search results XSLT but with different variables specified?

    This is my search results XSLT:

    <xsl:include href="show-job-search-details.xslt" />

    <xsl:template match="/">


    <!-- GET CATEGORY QUERY STRING -->
    <xsl:variable name="categoryquery">
    <xsl:choose>
            <xsl:when test="umbraco.library:Request('category') &lt;= 0 or string(umbraco.library:Request('category')) = '' or string(umbraco.library:Request('category')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
                    <xsl:value-of select="umbraco.library:Request('category')"/>
            </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    <!-- GET LOCATION QUERY STRING -->
    <xsl:variable name="locationquery">
    <xsl:choose>
            <xsl:when test="umbraco.library:Request('location') &lt;= 0 or string(umbraco.library:Request('location')) = '' or string(umbraco.library:Request('location')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
                    <xsl:value-of select="umbraco.library:Request('location')"/>
            </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

     

    <xsl:choose>
    <!-- RESULTS WHEN CATEGORY IS ANY AND LOCATION IS SELECTED -->
    <xsl:when test="$categoryquery = 'any' and $locationquery != 'any'">
    <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery]">

     <xsl:call-template name="displayResults">
     </xsl:call-template>
     
       
    </xsl:for-each>

    <xsl:if test="count(umbraco.library:GetXmlNodeById(1148)//node [@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery]) = 0">
            <div class="jobsearchresult">
     <p>Your search returned no results</p>
     <br />
     <a href="/browse-all-jobs.aspx">Click here to browse all jobs</a>
     </div>
    </xsl:if>

    </xsl:when>

    <!-- RESULTS WHEN LOCATION IS ANY AND CATEGORY IS SELECTED -->
    <xsl:when test="$locationquery = 'any' and $categoryquery != 'any'">


    <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)]"> 
      
      <xsl:call-template name="displayResults">
      </xsl:call-template>
      
    </xsl:for-each>


    <xsl:if test="count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)]) = '0'">
              <div class="jobsearchresult">
     <p>Your search returned no results</p>
     <br />
     <a href="/browse-all-jobs.aspx">Click here to browse all jobs</a>
     </div>
    </xsl:if>

     


    </xsl:when>

    <!-- RESULTS WHEN CATEGORY AND LOCATION ARE BOTH ANY -->
    <xsl:when test="$categoryquery = 'any' and $locationquery = 'any'">
            <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job']">

     <xsl:call-template name="displayResults">
     </xsl:call-template>
      
    </xsl:for-each>


    </xsl:when>


    <!-- RESULTS WHEN CATEGORY AND LOCATION ARE BOTH SELECTED -->
    <xsl:otherwise>

                     
                  
    <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]"> 
      
      <xsl:call-template name="displayResults">
      </xsl:call-template>
      
    </xsl:for-each>
    <xsl:if test="count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]) = 0">
              <div class="jobsearchresult">
     <p>Your search returned no results</p>
     <br />
     <a href="/browse-all-jobs.aspx">Click here to browse all jobs</a>
     </div>
    </xsl:if>
     
    </xsl:otherwise>
    </xsl:choose>

    </xsl:template>

     

     

     

     

     

    And this is the pagination XSLT I usually use:

     <xsl:template match="/">
      <xsl:variable name="recordsPerPage" select="10"/>
      <xsl:variable name="pageNumber">
       <xsl:choose>
        <xsl:when test="umbraco.library:RequestQueryString('page') &lt;= 1 or string(umbraco.library:RequestQueryString('page')) = '' or string(umbraco.library:RequestQueryString('page')) = 'NaN'">1</xsl:when>
        <xsl:otherwise>
         <xsl:value-of select="umbraco.library:RequestQueryString('page')"/>
        </xsl:otherwise>
       </xsl:choose>
      </xsl:variable>
      <xsl:variable name="numberOfRecords" select="count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job'])"/>
    div class="pagination">
      <xsl:if test="$pageNumber &gt; 1">
       <a href="{umbraco.library:NiceUrl($currentPage/@id)}/?page={$pageNumber - 1}">previous</a>
      </xsl:if>
      <xsl:call-template name="for.loop">
       <xsl:with-param name="i">1</xsl:with-param>
       <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
       <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job']) div $recordsPerPage)"></xsl:with-param>
      </xsl:call-template>
      <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
       <a href="{umbraco.library:NiceUrl($currentPage/@id)}/?page={$pageNumber + 1}">next</a>
      </xsl:if>
      </div>
    <img class="featuredjobdivider" src="/images/sq-dot-divider.jpg" alt="" />
     
       <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job']">
       <xsl:sort select="@nodeName" order="ascending" />
        <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )">
             
              <xsl:call-template name="displayResults">
              </xsl:call-template>
        </xsl:if>
       </xsl:for-each>
      

      
     </xsl:template>
     
     <xsl:template name="for.loop">
      <xsl:param name="i"/>
      <xsl:param name="count"/>
      <xsl:param name="page"/>
      <xsl:if test="$i &lt;= $count">
       <xsl:if test="$page != $i">
        <a href="{umbraco.library:NiceUrl($currentPage/@id)}/?page={$i}" >
         <xsl:value-of select="$i" />
        </a>
       </xsl:if>
       <xsl:if test="$page = $i">
        <span class="currentpage"><xsl:value-of select="$i" /></span>
       </xsl:if>
      </xsl:if>
      <xsl:if test="$i &lt;= $count">
       <xsl:call-template name="for.loop">
        <xsl:with-param name="i">
         <xsl:value-of select="$i + 1"/>
        </xsl:with-param>
        <xsl:with-param name="count">
         <xsl:value-of select="$count"/>
        </xsl:with-param>
        <xsl:with-param name="page">
         <xsl:value-of select="$page"/>
        </xsl:with-param>
       </xsl:call-template>
      </xsl:if>
     </xsl:template>
  • trfletch 598 posts 604 karma points
    Apr 29, 2010 @ 18:32
    trfletch
    0

    I have gone ahead and sorted this myself, just thought I would post my XSLT up here in case anyone else ran into this issue in future or if anyone wanted could suggest a better more efficient way of doing this. The XSLT basically displays the results from a form that contains two drop down lists (one called category and one called location) and shows 10 results on the page then displays links to show the next 10 results.

     <xsl:param name="currentPage"/>
      <xsl:include href="show-job-search-details.xslt" />
      <xsl:template match="/">
        <xsl:variable name="recordsPerPage" select="10"/>
        <xsl:variable name="pageNumber">
          <xsl:choose>
            <xsl:when test="umbraco.library:RequestQueryString('page') &lt;= 1 or string(umbraco.library:RequestQueryString('page')) = '' or string(umbraco.library:RequestQueryString('page')) = 'NaN'">1</xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="umbraco.library:RequestQueryString('page')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="thePage" select="umbraco.library:NiceUrl($currentPage/@id)"/>

        <!-- GET CATEGORY QUERY STRING -->
        <xsl:variable name="categoryquery">
          <xsl:choose>
            <xsl:when test="umbraco.library:Request('category') &lt;= 0 or string(umbraco.library:Request('category')) = '' or string(umbraco.library:Request('category')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="umbraco.library:Request('category')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <!-- GET LOCATION QUERY STRING -->
        <xsl:variable name="locationquery">
          <xsl:choose>
            <xsl:when test="umbraco.library:Request('location') &lt;= 0 or string(umbraco.library:Request('location')) = '' or string(umbraco.library:Request('location')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="umbraco.library:Request('location')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="previousUrl" select = "concat($thePage, '?', 'category=', $categoryquery, '&amp;', 'location=', $locationquery, '&amp;', 'page=', number($pageNumber -1))"/>
        <xsl:variable name="nextUrl" select = "concat($thePage, '?', 'category=', $categoryquery, '&amp;', 'location=', $locationquery, '&amp;', 'page=', number($pageNumber+1))"/>
        <xsl:choose>
          <!-- RESULTS WHEN CATEGORY IS ANY AND LOCATION IS SELECTED -->
          <xsl:when test="$categoryquery = 'any' and $locationquery != 'any'">
            <xsl:variable name="numberOfRecords" select="count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery])"/>
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery]) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
            <img class="searchresultdivider" src="/images/sq-dot-divider-455.jpg" alt="" />
            <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery]">
              <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )">
                <xsl:call-template name="displayResults">
                </xsl:call-template>
              </xsl:if>
            </xsl:for-each>
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery]) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
            <xsl:if test="count(umbraco.library:GetXmlNodeById(1148)//node [@nodeTypeAlias='Job' and string(data [@alias='umbracoNaviHide']) != '1' and string(data [@alias='location']) = $locationquery]) = 0">
              <div class="jobsearchresult">
                <p>Your search returned no results</p>
                <br />
                <a href="/browse-all-jobs.aspx">Click here to browse all jobs</a>
              </div>
            </xsl:if>
          </xsl:when>
          <!-- RESULTS WHEN LOCATION IS ANY AND CATEGORY IS SELECTED -->
          <xsl:when test="$locationquery = 'any' and $categoryquery != 'any'">
            <xsl:variable name="numberOfRecords" select="count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)])"/>
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)]) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
            <img class="searchresultdivider" src="/images/sq-dot-divider-455.jpg" alt="" />
            <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)]">
              <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )">
                <xsl:call-template name="displayResults">
                </xsl:call-template>
              </xsl:if>
            </xsl:for-each>
     
     <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)]) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>

            <xsl:if test="count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery)]) = '0'">
              <div class="jobsearchresult">
                <p>Your search returned no results</p>
                <br />
                <a href="/browse-all-jobs.aspx">Click here to browse all jobs</a>
              </div>
            </xsl:if>

          </xsl:when>
          <!-- RESULTS WHEN CATEGORY AND LOCATION ARE BOTH ANY -->
          <xsl:when test="$categoryquery = 'any' and $locationquery = 'any'">
            <xsl:variable name="numberOfRecords" select="count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job'])"/>
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job']) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
            <img class="searchresultdivider" src="/images/sq-dot-divider-455.jpg" alt="" />
            <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job']">
              <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )">
                <xsl:call-template name="displayResults">
              </xsl:call-template>
              </xsl:if>
             
            </xsl:for-each>
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node[@nodeTypeAlias='Job']) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
          </xsl:when>

          <!-- RESULTS WHEN CATEGORY AND LOCATION ARE BOTH SELECTED -->
          <xsl:otherwise>
            <xsl:variable name="numberOfRecords" select="count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery])"/>
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
            <img class="searchresultdivider" src="/images/sq-dot-divider-455.jpg" alt="" />
           
            <xsl:for-each select="umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]">
              <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )">
                <xsl:call-template name="displayResults">
              </xsl:call-template>
              </xsl:if>
            </xsl:for-each>
          
            <div class="pagination">
              <xsl:if test="$pageNumber &gt; 1">
                <a href="{$previousUrl}">previous</a>
              </xsl:if>
              <xsl:call-template name="for.loop">
                <xsl:with-param name="i">1</xsl:with-param>
                <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
                <xsl:with-param name="count" select="ceiling(count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]) div $recordsPerPage)"></xsl:with-param>
              </xsl:call-template>
              <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
                <a href="{$nextUrl}">next</a>
              </xsl:if>
     <xsl:comment><!-- --></xsl:comment>
            </div>
            <xsl:if test="count(umbraco.library:GetXmlNodeById(1148)//node [string(data [@alias='umbracoNaviHide']) != '1' and contains(data [@alias='category'], $categoryquery) and string(data [@alias='location']) = $locationquery]) = 0">
              <div class="jobsearchresult">
                <p>Your search returned no results</p>
                <br />
                <a href="/browse-all-jobs.aspx">Click here to browse all jobs</a>
              </div>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="for.loop">
        <xsl:param name="i"/>
        <xsl:param name="count"/>
        <xsl:param name="page"/>
        <!-- GET CATEGORY QUERY STRING -->
        <xsl:variable name="categoryquery">
          <xsl:choose>
            <xsl:when test="umbraco.library:Request('category') &lt;= 0 or string(umbraco.library:Request('category')) = '' or string(umbraco.library:Request('category')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="umbraco.library:Request('category')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <!-- GET LOCATION QUERY STRING -->
        <xsl:variable name="locationquery">
          <xsl:choose>
            <xsl:when test="umbraco.library:Request('location') &lt;= 0 or string(umbraco.library:Request('location')) = '' or string(umbraco.library:Request('location')) = 'NaN'">0</xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="umbraco.library:Request('location')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="thePage" select="umbraco.library:NiceUrl($currentPage/@id)"/>
        <xsl:variable name="pageUrl" select = "concat($thePage, '?', 'category=', $categoryquery, '&amp;', 'location=', $locationquery, '&amp;', 'page=')"/>
        <xsl:if test="$i &lt;= $count">
          <xsl:if test="$page != $i">
            <a href="{$pageUrl}{$i}" >
              <xsl:value-of select="$i" />
            </a>
          </xsl:if>
          <xsl:if test="$page = $i">
            <span class="currentpage">
              <xsl:value-of select="$i" />
            </span>
          </xsl:if>
        </xsl:if>
        <xsl:if test="$i &lt;= $count">
          <xsl:call-template name="for.loop">
            <xsl:with-param name="i">
              <xsl:value-of select="$i + 1"/>
            </xsl:with-param>
            <xsl:with-param name="count">
              <xsl:value-of select="$count"/>
            </xsl:with-param>
            <xsl:with-param name="page">
              <xsl:value-of select="$page"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:if>
      </xsl:template>
Please Sign in or register to post replies

Write your reply to:

Draft