据我所知,我已经正确地设置了我的部门/数据源。它被设置为包括系统:分页和每3个条目分页。
为了获得分页,我使用了一个流行的xslt实用程序
这是存档/类别页面:
<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>下面是我的调试,显示了唯一的分页现象:
<archive-listing>
<pagination total-entries="11" total-pages="4" entries-per-page="3" current-page="1" />总之,这是解决方案。按照callovarne的建议,做好步骤,他告诉我我能做到这一点。所以如果你有这个问题,一定要检查一下:
<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, '/$')"/>
发布于 2014-04-17 07:12:48
检查这些开始:
pagination元素中查找期望值我想您对分页模板的调用可能如下所示:
<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>https://stackoverflow.com/questions/23121769
复制相似问题