Created
June 4, 2014 13:34
-
-
Save birkir/8bef29580e0c362df0b0 to your computer and use it in GitHub Desktop.
Next/Prev News Items Navigation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:control="lisa:ControlInfo" xmlns:lisa="lisa:XsltExtensions" exclude-result-prefixes="lisa control"> | |
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/> | |
<xsl:param name="query-string"/> | |
<xsl:param name="NewsPageId"/> | |
<xsl:variable name="newsid" select="$query-string/param[@name = 'NewsId']" /> | |
<xsl:template match="News"> | |
<xsl:for-each select="Item"> | |
<xsl:sort select="Start" order="ascending"/> | |
<xsl:if test="NewsItemId = $newsid"> | |
<xsl:if test="position() > 1"> | |
<a href="/?pageid=&newsid={//Item[position() - 1]/NewsItemId}">Fyrri</a> | |
</xsl:if> | |
<xsl:if test="position() < count(//Item)"> | |
<a href="/?pageid=&newsid={//Item[position() + 1]/NewsItemId}">Næsta</a> | |
</xsl:if> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment