umbraco.library:DateGreaterThanOrEqualToday($date) to see if the day is upcoming.
The problem above is that it is the position() within the "for-each" loop that the condition (<= 1) is testing, so this will only work if the first event in your list also fits into your date requirements.
The other way, using the same method as above, would be to move the date logic into the for-each loop. (untested code below!)
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/node [string(data [@alias='umbracoNaviHide']) != '1' and umbraco.library:FormatDateTime(data[@alias='newsdate'],'yyyyMMdd') >= umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyyyMMdd')]">
show next event i calender
I have an event calender, where i wnat to show the next upcoming event on the frontpage of a site.
Im doing the following:
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/node [string(data [@alias='umbracoNaviHide']) != '1']">
<xsl:sort select="data [@alias = 'newsdate']" order="ascending"/>
<xsl:if test="(umbraco.library:FormatDateTime(data[@alias='newsdate'],'yyyyMMdd') >= umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyyyMMdd'))">
<xsl:if test="position() <= 1">
This is the event
</xsl:if>
</xsl:if>
</xsl:for-each>
But this only works if no events have passed the current date. if there was an event yesterday, the macro returns nothing...
Any ideas?
What about using DateGreaterThanOrEqualToday
umbraco.library:DateGreaterThanOrEqualToday($date) to see if the day is upcoming.
The problem above is that it is the position() within the "for-each" loop that the condition (<= 1) is testing, so this will only work if the first event in your list also fits into your date requirements.
The other way, using the same method as above, would be to move the date logic into the for-each loop. (untested code below!)
Could you make it a conditional select?
The first condition is when there are events in the future... the second is when all events are in the past.
Try something like
is working on a reply...