Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 DotNetNuke Articles

The RSS News Feed module has the option of using a news feed style sheet.  This comprises an XSL file, which may be uploaded separately with the File Manager or through the news feed.  The sample XSL file details given below will restrict the number of items shown to 5.  This is defined in the line:  <xsl:if test="position() <= 5">

<?xml version="1.0" ?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />
<xsl:param name="TITLE" /> 
<xsl:template match="rss">
 <!-- Do not show channel image --> 
<xsl:for-each select="channel/item">
 <xsl:if test="position() &lt;= 5">
 <br>
 <strong>
 <a href="{link}" target="_blank">
<xsl:value-of select="title" />
</a>
</strong>
<br /> 
<!-- only display markup for description if it's present -->
<xsl:value-of select="description" disable-output-escaping="yes" />
</br>
<br />
</xsl:if>
</xsl:for-each>
</xsl:template>
 <xsl:template match="description">
 <br>
<xsl:value-of select="." />
</br>
</xsl:template>
</xsl:stylesheet>

Apologies I have recently noticed that there was an error in the code posted. The correction was from

<xsl:if test="position() <= 5">

to

<xsl:if test="position() &lt;= 5">

NAT October 2005 (revised)


This article viewed: 2140 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

For DotNetNuke modules and skins take a look at:

Snowcovered

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Saturday, May 17, 2008