I have created XSLT to display all news archive using Content query webpart in sharepoint 2010. Currently the list display the record ordered by Created date ASC. I would like to know how i can implement group by Month and Year of create date ASC. Please advise, thank you
this is the template that i have so far:
<xsl:template name="allNews" match="Row[@Style='allNews']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="ArticleStartDate" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="Created">
<xsl:value-of select="ddwrt:FormatDateTime(string(@ArticleStartDate) ,1033 ,'dd/MM/yyyy')" />
</xsl:variable>
<xsl:variable name="LinkTarget">
<xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
</xsl:variable>
<!-- First row -->
<xsl:variable name="CurPosition" select="count(./preceding-sibling::*)" />
<xsl:if test="count(preceding-sibling::*)=0">
<div class="CQWP-AllNewsHeader">News Archieve</div>
</xsl:if>
<!-- Create var for alternate classes -->
<xsl:variable name="OddOrEven" >
<xsl:choose>
<xsl:when test="($CurPosition mod 2 = 0)">
<xsl:text>CQWP-AllNewsOdd</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>CQWP-AllNewsEven</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- All rows between the first and the last -->
<div id="linkitem" class="{$OddOrEven}">
<xsl:value-of select="$Created"/>
<a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}" >
<xsl:call-template name="FirstNWords">
<xsl:with-param name="TextData" select="$DisplayTitle"/>
<xsl:with-param name="WordCount" select="7"/>
<xsl:with-param name="MoreText" select="'...'"/>
</xsl:call-template>
</a>
</div>
</xsl:template>