Hi,
There was a question about customizing an XSL Stylesheet for the repository, so i started a new thread here.
My Newsfeed shows on the home page like this:
Files added on: Thu Apr 13, 2006
Intersky Summer 2006
Files added on: Sun Apr 09, 2006
European Air Express
MaxjetSummer 2006
Dauair
The XSL stylesheet reads through the entrys, takes the newest 5 dates, then for each date, lists the titles of the files added, and sorts them alphabetically under each date.
Here is the stylsheet.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:key name="FilesByDate" match="item" use="substring(pubDate, 1,16)" />
<xsl:template match="rss/channel">
<xsl:for-each select="item[count(. | key('FilesByDate', substring(pubDate, 1,16))[1]) = 1]">
<xsl:if test="position() < 6">
<br/><font style="font-weight : bolder; text-decoration: underline; ">Files added on: <xsl:value-of select="concat(substring(pubDate, 1,3),' ',substring(pubDate, 9,4),substring(pubDate, 6,2),', ',substring(pubDate, 13,4))"/></font>
<br/>
<xsl:for-each select="key('FilesByDate', substring(pubDate, 1,16))">
<div class="itemtitle">
<font style="font-weight : normal; ">
<a href="{guid}" title="{description}"><xsl:value-of select="substring-after(title,'File Library - ')" disable-output-escaping="yes"/></a></font>
</div>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Line 4 sets up a variable for me to use elsewhere in the stylesheet, called FilesByDate
Line 6 starts counting the number of dates, and line 7 checks to make sure i have not used more than 6 dates, which gives me my 5 dates i want to display.
Line 8 starts the "Files added on" Date line in my feed, but, then sorts the date in the way i want it displayed.
Line 11 lists the files for each date, and line 14 sets up the title, removing the libray module name from the title, url link to the file, and shows description when you move the mouse over the url.
Thats pretty much it. Check out www.dnncreative.com for some easy XSL stylesheet pointers.