I'm just trying to sort my RSS list. I've tried several ways to sort after my
for-each and also within apply-templates.
The first sort is on updateDate to get the newest update date. Maybe that is
affecting the later sort? (I've tried it w/o no sort after the first one).
I must be getting the syntax wrong or not understand the context because it
doesn't make any difference, I get get the sort order to change. My only
parameter in this case is ?t=news:
I've tried the following sorts after the for-each area and apply templates:
<xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <!-- params passed via querystring: p=the page/world name (assigned to "pageName"), t=the one word title of the feed (assigned to "feedTitle"), n=the number of recent stories to show in the feed (assigned to "feedNumItems") --> <xsl:variable name="pageName"> <xsl:choose> <xsl:when test="string-length(umbraco.library:Request('p')) > 0"> <xsl:text>cprFeatures</xsl:text> <xsl:value-of select="string(umbraco.library:Request('p'))" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="''" /> </xsl:otherwise> </xsl:choose> </xsl:variable>
<!-- takes querystring keyword parameters and construct description -->
<xsl:variable name="feedDescription"> <xsl:value-of select="'Stories related to '"/> <xsl:value-of select="$feedTitle" /> </xsl:variable>
<!-- This gets all news and events and orders by updateDate to use for the pubDate in RSS feed --> <xsl:variable name="pubDate"> <xsl:for-each select="$currentPage/node">
<xsl:template match="/"> <xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/> <xsl:text disable-output-escaping="yes"><?xml version="1.0" encoding="UTF-8"?></xsl:text> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <!-- sets up the header for the feed --> <channel> <title> <xsl:value-of select="$feedTitle"/> </title> <image> <url>http://capradio.org/images/logo250px.png</url>; <title>Capital Public Radio</title> <link>http://capradio.org</link>; </image> <link> <xsl:value-of select="$SiteURL"/> </link> <pubDate> <xsl:value-of select="$pubDate"/> </pubDate> <generator>umbraco</generator> <description> <xsl:value-of select="$feedDescription"/> </description> <language>en</language>
<!-- find out which feed to serve based on querystring parameter --> <!-- if the feed parameter (keyword) is passed, use nodes where the keyword field contains the keyword parameter --> <!-- if no feed (keyword) parameter is passed, then show rss from all nodes -->
XSLT SORT, RSS
Hi,
I'm just trying to sort my RSS list. I've tried several ways to sort after my for-each and also within apply-templates.
The first sort is on updateDate to get the newest update date. Maybe that is affecting the later sort? (I've tried it w/o no sort after the first one).
I must be getting the syntax wrong or not understand the context because it doesn't make any difference, I get get the sort order to change. My only parameter in this case is ?t=news:
I've tried the following sorts after the for-each area and apply templates:
is working on a reply...