Question

I have set up my section/data source correctly as far as I can tell. It is set up to include system:pagination and also paginates per 3 entries.

To get pagination I am using a popular xslt utility

This is the archive/category page:

    <xsl:import href="../utilities/master.xsl"/>
    <xsl:import href="../utilities/pagination.xsl"/>
    <xsl:import href="../utilities/get-article.xsl"/>
    <xsl:template match="data">

        <div class="col span-9">
            <div class="span-9">
              <h4 class="nudge-3"><xsl:value-of select="categories/entry/title[@handle = $category]"/></h4>
            </div>
              <xsl:apply-templates select="archive-listing/entry" mode="short"/>
          <xsl:call-template name="pagination">
        <xsl:with-param name="pagination" select="archive-listing/pagination"/>
            <xsl:with-param name="pagination-url" select="{$current-url}/archive/category/{title/@handle}?page=$"/>
        </div>
    </xsl:call-template>

                <div id="sidebar" class="col last span-3">
                                <xsl:call-template name="social"/>
            <xsl:call-template name="category"/>
            <xsl:call-template name="tag"/>
            <xsl:call-template name="external-links"/>
        </div>  
    </xsl:template>

</xsl:stylesheet>

Here is my ?debug showing the only occurrence of pagination:

<archive-listing>
    <pagination total-entries="11" total-pages="4" entries-per-page="3" current-page="1" />

Anyway, here's the solution. Following callovarne's advice and doing the steps he told me I was able to arrive at this. So if you're having that problem be sure to check it out:

      <xsl:apply-templates select="archive-listing/entry" mode="short"/>
  <xsl:call-template name="pagination">
<xsl:with-param name="pagination" select="archive-listing/pagination"/>
    <xsl:with-param name="pagination-url" select="concat($root, '/archive/category/', $category, '/$')"/>

Was it helpful?

Solution

Check these to start:

  • datasource output: look for expected values in the pagination element in ?debug
  • that the utility can access the passed parameters

I imagine your call to the pagination template might look something like this:

    <xsl:call-template name="pagination">
        <xsl:with-param name="pagination" select="archive-listing/pagination"/>
        <xsl:with-param name="pagination-url" select="concat($current-url, '/archive/category/', title/@handle, '?page=$')"/>
    </xsl:call-template>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top