Hi all i'm tearing my hair out with this one, so wonder if anyone could help. I have a news section on my website set up in the following structure:
1 News & Events
1.1 News List
1.1.1 2010
1.1.1.1 January
1.1.1.1.1 News Item 1
1.1.2 2009
1.1.2.1 January
1.1.2.1.1 News Item 1
What i want my xslt to do is select only the news items from 2009 if your on the 2009 page and 2010 if your on the 2010 page, currently this piece of xslt just lists all news items:
Help with news xslt
Hi all i'm tearing my hair out with this one, so wonder if anyone could help. I have a news section on my website set up in the following structure:
1 News & Events
1.1 News List
1.1.1 2010
1.1.1.1 January
1.1.1.1.1 News Item 1
1.1.2 2009
1.1.2.1 January
1.1.2.1.1 News Item 1
What i want my xslt to do is select only the news items from 2009 if your on the 2009 page and 2010 if your on the 2010 page, currently this piece of xslt just lists all news items:
<xsl:for-each select="$currentPage/ancestor-or-self::node//node [@nodeTypeAlias ='Proactis News Item']">
<h2><xsl:value-of select="@nodeName"/></h2>
<p><xsl:value-of select="data [@alias='shortDescription']"/></p>
<xsl:choose>
<xsl:when test="string(data [@alias='newsReleaseDate']) != ''">
<p><xsl:value-of select="umbraco.library:FormatDateTime(data [@alias='newsReleaseDate'], 'dddd dd MMMM yyyy')"/></p>
</xsl:when>
<xsl:otherwise>
<p><xsl:value-of select="umbraco.library:FormatDateTime(@createDate, 'dddd dd MMMM yyyy')"/></p>
</xsl:otherwise>
</xsl:choose>
<p><a href="{umbraco.library:NiceUrl(@id)}" title="Read more">» Read more</a></p>
</xsl:for-each>
Any help would be much appreciated!!
If $curretPage is the 2009 page you should be able to use the following for-each select
hth,
Harald
Cheers bud that did just the job, far simpler than i thought!!
is working on a reply...