-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtpl-paginate.xslt
45 lines (41 loc) · 1.89 KB
/
tpl-paginate.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY amp "&"> <!ENTITY euro "€"> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template name="paginate">
<xsl:param name="i"/>
<xsl:param name="count"/>
<xsl:param name="page"/>
<xsl:if test="$i <= $count">
<xsl:if test="$page != ($i)">
<li>
<a>
<xsl:attribute name="href"><xsl:value-of select="umbraco.library:NiceUrl($currentPage/@id)" />/<xsl:value-of select="$regionQS" />/<xsl:value-of select="$categoryQS" />/page-<xsl:value-of select="$i - 1" /></xsl:attribute>
<xsl:value-of select="$i" /></a>
</li>
</xsl:if>
<xsl:if test="$page = ($i) ">
<li><a class="active"><xsl:value-of select="$i" /></a></li>
</xsl:if>
</xsl:if>
<xsl:if test="$i <= $count">
<xsl:call-template name="paginate">
<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>
</xsl:stylesheet>