Question How do I include the contents of an RSS feed in a page?
Answer To include an RSS feed content in a page use the rss macro

{rss:feed=http://www.ludovic.org/blog/index.rdf|count=10}

The macro can take the following parameters:

  • feed: url of an RSS feed
  • img: if 'true' and if feed has an image, image will be included
  • align: if an image will be included, use this alignment
  • css: if 'true', elements will be created with CSS styles; otherwise, static formatting methods will be used
  • count: an integer, the maximum number of feed items to display
  • full: if 'true', descriptions for each item will be included. Otherwise, just titles
  • search: if 'true' and if feed has a search field, field will be included
Advanced users can get finer control over the feed content by working directly with the feed plugin rather than the feed macro:
\#set(\$myfeed=\$xwiki.feed.getFeed(\$feedUrl))
$myfeed then contains a SyndFeed object, whose members can be accessed in a Velocity or Groovy script.
Version 1.11 last modified by Vincent Massol on 17/08/2007 at 13:55

Comments 4

Angstrom | 20.01.2005 at 02:02 PM
Is it possible to access the other tags in a feed such as Description , sometimes the Title is not enough.

Ludovic Dubost | 20.02.2005 at 07:27 PM
No.. the RSS Macro is limited. I'm planning to include a full RSS API in the XWiki Api based on Rome, which would give maximum flexibility.

schmloof | 26.09.2005 at 03:59 AM
Is it possible to edit the width of an RSS feed?

Ludovic Dubost | 26.09.2005 at 09:31 PM
Yes.. you can play around with the CSS styles:

<style type="text/css">
.rssfeed {
  width: 300px;
}
</style>

Attachments 0

No attachments for this document

Creator: SebPaquet on 2005/02/20 19:27
This wiki is licensed under a Creative Commons license
1.5.2.12758