Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
<xsl:when test="current()/@nodeTypeAlias = 'EventItem'">
<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 ;)
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?
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
<xsl:for-each ...> <xsl:if test="position() <= $noOfItems"> Stuff in here you want to do for each item </xsl:if></xsl:for-each>
Hope this helpsWarren
yes this helped...It's working fine now. Thanks for your quick reply and help.
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:sort select="@createDate" order="ascending"/>
Change this to
<xsl:sort select="@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
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted