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
Hello all
I want to make 1 templates which will show news written by me ....
If i add any new news then it should be shown along with old news ....
ie. new news should be shown 1st & then old news should be shown 2nd....
I am not understanding that how to make xslt & templates for this as i am quite new to umbraco ...
So please help me in doing this .....
<xsl:for-each select="umbraco.library:GetXmlAll()//MyNewsItemDocType"> <xsl:sort select="@updateDate" order="descending"/> <!-- display news items here --></xsl:for-each>
This will iterate all news item doctypes from across the site, sorted by last updated, with most recent first.
If there is a "News Date" field on your doctype you can obviously use that instead of @updateDate.
Here is a slight variation to only display 5 most recent items (useful on home pages for example):
<xsl:for-each select="umbraco.library:GetXmlAll()//MyNewsItemDocType"> <xsl:sort select="@updateDate" order="descending"/> <xsl:if test="position() < 5"> <!-- display news items here --> </xsl:if></xsl:for-each>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Xslt & templates for news feed
Hello all
I want to make 1 templates which will show news written by me ....
If i add any new news then it should be shown along with old news ....
ie. new news should be shown 1st & then old news should be shown 2nd....
I am not understanding that how to make xslt & templates for this as i am quite new to umbraco ...
So please help me in doing this .....
This will iterate all news item doctypes from across the site, sorted by last updated, with most recent first.
If there is a "News Date" field on your doctype you can obviously use that instead of @updateDate.
Here is a slight variation to only display 5 most recent items (useful on home pages for example):
is working on a reply...