HomeHomeDotNetNuke Forg...DotNetNuke Forg...Module ForumsModule ForumsNews FeedsNews FeedsLimit number of items viewable in News FeedLimit number of items viewable in News Feed
Previous
 
Next
New Post
6/14/2007 9:40 AM
 

Is there a way to limit the number of news items showing up in the newsfeed module?

 
New Post
6/14/2007 12:19 PM
 

Npennington,

In the XSL file if you wrap the display settings in:
<xsl:if test="position() &lt; n"> where n is the number you want less than. So for example, my very simple feed that shows the first 5 items is:

- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
  <xsl:output method="html" />
- <xsl:template match="/">
- <xsl:for-each select="rss/channel/item">
- <xsl:if test="position() &lt; 6">
- <a href="{link}" target="_Blank">
- <strong>
  <xsl:value-of select="title" />
  </strong>
  </a>
  <br />
  <xsl:value-of disable-output-escaping="yes" select="description" />
  (
  <xsl:value-of select="pubDate" />
  )
  <hr />
  </xsl:if>
  </xsl:for-each>
  </xsl:template>
  </xsl:stylesheet>

Hope this helps?

Regards

Pete

Aarrgghhh! User Error DNN Version: 4.4/4.5
Websites: taxinumber.com/taxi-today.com
Like DNN? Yes! Very much, congratulations!
Poor eyesight? Yes! Thankyou very much!
 
New Post
6/25/2007 7:21 AM
 

I, too, am looking for a way to limit the number of items displayed by a news feed.

I am working with an RSS feed from the Associated Press that is displaying 10 news headlines and excerpts, which is much more lengthy than what I am looking for (perhaps 3 or 4, max).  I've tried looking in the module's settings, but don't see anything that looks like it would allow me to change the default number of "items" displayed in the feed.  Can anyone help me with this?

Here's a screen shot (scaled down) of what I'm talking about...

Again, I would like to get this list of 10 down to a list of 3 to 4.

Thanks!

--Daniel

 
New Post
6/25/2007 9:57 AM
 

Yes you can use an XSL stylesheet to modify the RSS output to the look/feel you want.

Here's a sample I just did on our site http://www.profitimo.com/ArticlesBlogs/tabid/53/Default.aspx (at the btm of the page).

To do this...

Newsfeed Module/Edit Module/

Under Newsfeed Stylesheet, click upload XSL file below...

****************************
CREATE XLS file using Notepad and save it as "name.xsl"
****************************

<?xml version="1.0"?>
<!-- Edited by Lee Sykes DNN Creative Magazine http://www.dnncreative.com -->
<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>
 <!-- to open links in a new window, change target="_main" to target="_new" -->
    <strong><a style="color:#800000; text-decoration:none" href="{link}"  target="_main"><xsl:value-of select="title"/></a></strong><br></br>

    <!-- only display markup for description if it's present -->
    <xsl:value-of disable-output-escaping="yes" select="substring(description,0,300)"/>...

    </br>
    <br></br>
  </xsl:if>
  </xsl:for-each>
</xsl:template>

<xsl:template match="description">
  <br>
    <xsl:value-of select="."/>
  </br>
</xsl:template>

</xsl:stylesheet>


Justin Lim www.profitimo.com
 
New Post
5/7/2008 5:14 PM
 

This works brilliantly! Just what I was looking for. I appreciate your help Justin.

You can view this in action on our website: OCEC.us

 

 
Previous
 
Next
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Module ForumsModule ForumsNews FeedsNews FeedsLimit number of items viewable in News FeedLimit number of items viewable in News Feed


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.