Skip to content

Instantly share code, notes, and snippets.

@qur2
Created September 17, 2011 21:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qur2/1224375 to your computer and use it in GitHub Desktop.
Save qur2/1224375 to your computer and use it in GitHub Desktop.
For SymphonyCMS, provides dynamic pagination-url to Nick Dunn pagination template. It holds the current URL and params while updating the page.
<xsl:call-template name="pagination">
<xsl:with-param name="pagination" select="pagination" />
<!-- build an url that holds every get params, except the page -->
<xsl:with-param name="pagination-url">
<xsl:value-of select="/data/params/root" />
<xsl:value-of select="/data/params/parent-path" />
<xsl:text>?</xsl:text>
<xsl:for-each select="/data/params/*[contains(name(), 'url-')]">
<xsl:if test="not(name(.) = 'url-page')">
<xsl:value-of select="concat(substring-after(name(), 'url-'), '=', text())" />
</xsl:if>
</xsl:for-each>
<xsl:text disable-output-escaping="yes">&amp;</xsl:text>
<xsl:text>page=$</xsl:text>
</xsl:with-param>
</xsl:call-template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment