I have a piece of xslt which shows my teaser "newsTeaser" field from the latest news item on my site (this appears on every page in a "News panel"). I am having a bit of trouble with it showing the latest news item though. My code is:
<xsl:for-each select="$currentPage/ancestor-or-self::root//node [string(data [@alias='newsTeaser']) != '' and string(data [@alias='umbracoNaviHide']) != '1' and @nodeTypeAlias='NewsItem' ]">
This code is currently showing my second newest news item though. Both the new ones were created today "4th June" - so I wonder if it can't distinguish between the time they were created?
Help with showing latest news item
Hi everyone,
I have a piece of xslt which shows my teaser "newsTeaser" field from the latest news item on my site (this appears on every page in a "News panel"). I am having a bit of trouble with it showing the latest news item though. My code is:
This code is currently showing my second newest news item though. Both the new ones were created today "4th June" - so I wonder if it can't distinguish between the time they were created?
Any help would be great.
Garry.
Hi Garry,
You are sorting on your newsTeaser field, it looks like you want to be sorting on date the node was created (@createDate).
Best of luck
Rich
Ah yes, of course.
Thanks very much Rich!
Garry.
is working on a reply...