Hi fed,
Here's what I'm using for a family blog:
Code:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<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"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Don't change this, but add a 'contentPicker' element to -->
<!-- your macro with an alias named 'nodeId' -->
<xsl:variable name="blogNodeId" select="/macro/nodeId"/>
<xsl:variable name="months" select="umbraco.library:Split('Jan,Feb,Maa,Apr,Mei,Jun,Jul,Aug,Sep,Okt,Nov,Dec',',')"/>
<xsl:template match="/">
<!-- The fun starts here -->
<xsl:if test="count(umbraco.library:GetXmlNodeById($blogNodeId)/node [@nodeTypeAlias = 'umbracoBlogDateFolder' and @level = 3]) > 0">
<h3>Kunt ge't niet meer vinden? Probeer het archief eens...</h3>
</xsl:if>
<xsl:for-each select="umbraco.library:GetXmlNodeById($blogNodeId)/node [@nodeTypeAlias = 'umbracoBlogDateFolder' and @level = 3]">
<xsl:sort select="@nodeName" data-type="number" order="descending" />
<a href="{umbraco.library:NiceUrl(@id)}"><b><xsl:value-of select="@nodeName"/></b></a>:
<xsl:for-each select="./node [@nodeTypeAlias = 'umbracoBlogDateFolder' and @level = 4]">
<xsl:sort select="./@nodeName" order="descending" />
<xsl:variable name="month" select="./@nodeName"/>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="$months/value[number($month)]/text()"/></a>
<xsl:if test="position() < last()-1">
<xsl:text>, </xsl:text>
</xsl:if>
<br/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Basically, I'm sending in a node Id, which is the top level node for my blog in the content tree, and perform a double for-each loop. First will iterate the date folders at 'year' level, the second inner loop is iterating the date folders at 'month' level.
Don't bother about the Dutch text, should replace that of course :)
Have also created an array holding the Dutch abbreviates for months, making it easier to replace the month number by its text counterpart.
Hope that helps,
/Dirk
level 1 certified - umbraco blog at
netaddicts.be