For the event 'Codegarden 09' the date displayed on the News page should be 22.06.09 (the event date) but it instead shows 27.02.09 (the create date). This is on version 2.0.2.
Hiya, Yes you beat me to it, due to a typo with the node type alias (ie missing the CWS_ prefix which are on all document types) Well I might say this is in an intentional error in the future and say its a way for people to learn Umbraco easier ;)
sorry for writting again, I have one question regarding the restriction (limit) of items displayed in NewsEventsSubNavi.xslt. If I'm correct there are now displayed the first three created events or news by date. Is there a way that there would be displayed the last three events or news by publish date?
Hey Andra, In the XSLT underneath the <xsl:for-each> there is a <xsl:sort> you just need to update it with the value you wish to sort on.
<xsl:sortselect="@createDate"order="ascending"/>
Change this to
<xsl:sortselect="@updateDate"order="ascending"/>
This will use the date of when an item is updated (published). So if you create a news item in the past and go back and republish it, it will go to the top of the list. Hence my choice to use @createDate iver @updateDate
ListNewsEvents.xslt
It seems that the following bit of XSLT doesn't work correctly:
<!-- Date Format: 15.12.08 -->
<xsl:choose>
<xsl:when test="current()/@nodeTypeAlias = 'EventItem'">
<xsl:value-of select="umbraco.library:FormatDateTime(data [@alias='eventDate'], 'dd.MM.yy')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="umbraco.library:FormatDateTime(@createDate, 'dd.MM.yy')"/>
</xsl:otherwise>
</xsl:choose>
For the event 'Codegarden 09' the date displayed on the News page should be 22.06.09 (the event date) but it instead shows 27.02.09 (the create date). This is on version 2.0.2.
Sorted it
<xsl:when test="current()/@nodeTypeAlias = 'EventItem'">
should be:
<xsl:when test="current()/@nodeTypeAlias = 'CWS_EventItem'">
Hiya,
Yes you beat me to it, due to a typo with the node type alias (ie missing the CWS_ prefix which are on all document types)
Well I might say this is in an intentional error in the future and say its a way for people to learn Umbraco easier ;)
Warren
Hi,
is there a way that I could add at the ListNewsEvents.xslt a limit of showing only 3 Items like at the NewsEventsSubNavi.xslt?
If I add the variable <xsl:variable name="noOfItems" select="3" />, where do I insert it then?
Regards,
Andra
Hello Andra,
If you do a bit of comparison work you should be able to figure this out.
However if you put the variable towards the top of the file, just to make life easy in order to find it and change it later on.
In the <xsl:for-each> where we are listing out each item you need to insert an <xsl:if> inside it.
For example
Hope this helps
Warren
Hi Warren,
yes this helped...It's working fine now. Thanks for your quick reply and help.
Regards,
Andra
Hey,
sorry for writting again, I have one question regarding the restriction (limit) of items displayed in NewsEventsSubNavi.xslt. If I'm correct there are now displayed the first three created events or news by date. Is there a way that there would be displayed the last three events or news by publish date?
Regards,
Andra
Hey Andra,
In the XSLT underneath the <xsl:for-each> there is a <xsl:sort> you just need to update it with the value you wish to sort on.
Change this to
This will use the date of when an item is updated (published). So if you create a news item in the past and go back and republish it, it will go to the top of the list. Hence my choice to use @createDate iver @updateDate
Thanks,
Warren :)
is working on a reply...