Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...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 11:40 AM
 

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

 
New Post
6/14/2007 2: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 9: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 11: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 7: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
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsLimit number of items viewable in News FeedLimit number of items viewable in News Feed


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out