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 FeedsDisplay only 3 itemDisplay only 3 item
Previous
 
Next
New Post
3/30/2009 10:31 AM
 

Hi all,

I want display only 3 item of an RSS newsfeed.

Can you help me?

 
New Post
3/30/2009 11:24 AM
 

When posting asking for help, it is helpful for those wanting to help, if you would follow some simple guidelines:

1. Give the module version you are using
2. Give the DNN version you are using
3. State if this is a pubic hosted install or a local install

Now, since you don't state any of the above, I'll give you the two possibilities, that I see most often.

Using, News module v4.0.x: 
There is an option in the Module Settings area that allows you to choose how many items to display.  Its default value is -1, which the programming method uses as meaning 'display all avaliable'.  Any other positive value can be entered.  If you are using this module to render aggregate feeds, remember that only the specified number of entries are used for the total number of entries retreived, which means if your first feed has 20 items, and your second feed has 30, and you specify the module to show 15 items, the first 15 items from the first feed are going to display, not the the first 15 from each feed.  Buggy?  Yeah, but that's the way it works now.

Using the News module v3.0.x:
You have to create a custom XSL and add a bit of code to limit the number of items.  Save the file and upload to your web site.  Then, you would specify that file as your XSL transformation file.  You need to know a bit about coding XSL to do it, and understand it, though.

The code snippet to limit the items selected to the first 5 items looks something like this:
<xsl:template match="item">
<xsl:if test="position() &lt; 6">
<!-- your code here -->
</xsl:if>

If you need the full xsl, search my posts, I'm sure I've given it out several times.  You could google it too, as others have posted the info, as well.

 
New Post
3/30/2009 11:32 AM
 

Also, the above is not the only way to do it, but a way to do it.

You could use replace the item select statement with this line in your custom XSL:

<xsl:for-each select="channel/item[position() &lt;= 5]">
 

Just to mention again, I've given many posts with complete custom XSL solutions, but don't have time to do it anymore on these forums.  Best bet is to use Google and use the search phrase 'DNN RSS XSL iwonder' or "DNN XSL limit items", or something similar should bring up a bunch of hits.  Also, check out my blog for info, or a Lee's DNNCreate site for a lot of tutorials, and lastly, to learn more about XML/XSL try the site TopXML.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsDisplay only 3 itemDisplay only 3 item


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