[Yanel-commits] rev 51297 - public/yanel/trunk/src/contributions/resources/search/htdocs

michi at wyona.com michi at wyona.com
Thu Jul 15 09:50:33 CEST 2010


Author: michi
Date: 2010-07-15 09:50:33 +0200 (Thu, 15 Jul 2010)
New Revision: 51297

Modified:
   public/yanel/trunk/src/contributions/resources/search/htdocs/results2xhtml.xsl
Log:
pagination added

Modified: public/yanel/trunk/src/contributions/resources/search/htdocs/results2xhtml.xsl
===================================================================
--- public/yanel/trunk/src/contributions/resources/search/htdocs/results2xhtml.xsl	2010-07-15 07:39:46 UTC (rev 51296)
+++ public/yanel/trunk/src/contributions/resources/search/htdocs/results2xhtml.xsl	2010-07-15 07:50:33 UTC (rev 51297)
@@ -43,6 +43,7 @@
         <xsl:apply-templates select="/y:search/y:no-query"/>
         <p>Search results provider: <xsl:value-of select="/y:search/y:provider"/></p>
         <xsl:apply-templates select="/y:search/y:results"/>
+        <xsl:apply-templates select="/y:search/y:pages"/>
         <xsl:if test="not(/y:search/y:results) and not(/y:search/y:exception) and not(/y:search/y:no-query)">
           <p>Your search - <xsl:value-of select="/y:search/y:query"/> - did not match any documents</p>
         </xsl:if>
@@ -52,7 +53,7 @@
   </xsl:template>
 
   <xsl:template match="y:results">
-    <h2>All Results (<a href="?q={../y:query}&amp;provider={../y:provider}&amp;yanel.resource.viewid=xml">as XML</a>)</h2>
+    <h2>All Results (<a href="?q={../y:query}&amp;provider={../y:provider}&amp;page={/y:search/y:results/@page-number}&amp;yanel.resource.viewid=xml">as XML</a>)</h2>
     <br/>
     <xsl:apply-templates select="y:result"/>
   </xsl:template>
@@ -80,6 +81,28 @@
     No query was specified! Please make sure to enter a search term.
     </p>
   </xsl:template>
+
+  <xsl:template match="y:pages">
+<p>
+    <xsl:if test="y:previous">
+      <a href="?q={/y:search/y:query}&amp;page={y:previous}">Previous</a>&#160;&#160;&#160;&#160;&#160;
+    </xsl:if>
+    <xsl:for-each select="y:page">
+     <xsl:choose>
+       <xsl:when test="@selected = 'true'">
+         <xsl:value-of select="."/>
+       </xsl:when>
+       <xsl:otherwise>
+         <a href="?q={/y:search/y:query}&amp;page={.}"><xsl:value-of select="."/></a>
+       </xsl:otherwise>
+     </xsl:choose>
+     <xsl:if test="position() != last()">,&#160;</xsl:if>
+    </xsl:for-each>
+    <xsl:if test="y:next">
+      &#160;&#160;&#160;&#160;&#160;<a href="?q={/y:search/y:query}&amp;page={y:next}">Next</a>
+    </xsl:if>
+</p>
+  </xsl:template>
   
   <xsl:template match="@*|node()" priority="-1">
     <xsl:copy>



More information about the Yanel-commits mailing list