I have create a newslist for a clients website. The neslist shows a max amount of news, so only the 4 newest items get displayed... And it works fine, the news get displayed correctly...
But I want it to NOT include the newest item (it has to be displayed by another macro i made).
Listing news...
Hi everyone
I have create a newslist for a clients website. The neslist shows a max amount of news, so only the 4 newest items get displayed... And it works fine, the news get displayed correctly...
But I want it to NOT include the newest item (it has to be displayed by another macro i made).
My XSLT looks like this...
<xsl:param name="currentPage"/>
<xsl:variable name="maxItems" select="/macro/maxItems"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:sort select="@createDate" order="ascending" />
<xsl:if test="position() >= $maxItems">
<div class="box border">
<h1><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></h1>
<xsl:value-of select="newsTeaser"/>
</div>
</xsl:if>
</xsl:for-each>
</xsl:template>
Can anyone help me out how to accomplish this?
Kind regards
Mikkel
There is an error in the XSLT above...
The "Sort" and "if" statements should look like this:
<xsl:sort select="@createDate" order="descending" />
<xsl:if test="position() <= $maxItems">
I still havent solved my issue with NOT showing the NEWEST item...
Kind regards
Mikkel
Hi Mikkel,
To skip the first item in the for-each loop you could try:
Thanks,
Tom
Works like a charm... I knew it was a simple change somehow :)
Thank you so much, Tom
Kind regards
Mikkel
is working on a reply...