Here i stuck at problem of creating using months from my news archive.
My reuirement is that i want to display a months whose news is there in particular month and if there are more than one news pertaining to that month than also it would be visiable only once.. and if there are no news for that month than no news link should be displayed.
I think we need a bit of additional information. What does your input nodes (under the $currentPage) look like, what output would you be expecting and what output do you actually get? Do you get any results at all for some nodes/months?
Need to generate month nodes
Hi All,
Here i stuck at problem of creating using months from my news archive.
My reuirement is that i want to display a months whose news is there in particular month and if there are more than one news pertaining to that month than also it would be visiable only once.. and if there are no news for that month than no news link should be displayed.
I am using follwoing code snipet in xslt.
<xsl:key name="months" match="node" use="umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMyyyy')"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/node [string(data [@alias='HidePage']) != '1'] ">
<xsl:if test="generate-id() = generate-id(key('months', umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMyyyy')))">
<li class="item">
<a href="../../../regis-news/recent-media.aspx?month={umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMMyyyy')}">
<xsl:value-of select="umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMM yyyy')"/>
<br/>
</li>
</xsl:if>
</xsl:for-each>
Please help me as i am not getting any result for Jun and Jan months.
Regards,
Jigar
Hi Jigar,
I think we need a bit of additional information. What does your input nodes (under the $currentPage) look like, what output would you be expecting and what output do you actually get? Do you get any results at all for some nodes/months?
>Tommy
Hi Jigar,
Take a look at this one - http://www.jenitennison.com/xslt/grouping/index.html
/jesper
is working on a reply...