"rss" Macro

Last modified by Vincent Massol on 2026/10/22 12:26

Reference

Description

The rss Macro displays the latest entries of an RSS feed in a wiki page, each one as a link to the entry.

In the Macro list of the editors it appears as "RSS", in the "Content" category. It is built on the "box" Macro: by default the entries are framed in a box topped by the feed's title. For a step-by-step procedure, see Display an RSS Feed in a Page.

Usage

{{rss feed="https://example.org/feed.rss"/}}

The Macro is standalone only: it cannot be used inside a paragraph. Its content is optional; when present, it is parsed as wiki content and displayed in the box, between the feed's title and its entries.

The feed must be reachable from the XWiki server, over HTTP or HTTPS, and the server must start answering within 5 seconds.

RSS Display 15.7+ The XWiki server only fetches feeds hosted on public addresses: a URL pointing to the XWiki server itself or to a private network, such as an intranet, is refused, and so is any URL the feed redirects to. Retrieving the feed must also take less than 10 seconds, and the feed must be smaller than 5 MB.

The content of each entry, displayed with content="true", is HTML from a remote site: it is cleaned in restricted mode before being displayed, which removes scripts and other active content.

Output and CSS Classes

The output carries the following CSS classes, which a skin or a skin extension can style.

ClassElement
rssfeedThe element containing the whole output, with or without decoration.
rsschanneltitleThe feed's title, a link to the feed's site followed by an RSS icon. Only with decoration="true".
rssitemtitleThe title of each entry, a link to the entry.
rssitemdescriptionThe content of each entry. Only with content="true".

Errors

When the feed cannot be read, the Macro displays an error instead of the feed.

MessageCause
The required 'feed' parameter is missingfeed is empty.
Unsupported protocol for the feed URL [<url>], only http and https are allowedRSS Display 15.7+ The URL, or a URL it redirects to, is neither an http nor an https URL.
Access to [<url>] is not allowedRSS Display 15.7+ The URL, or a URL it redirects to, points to the XWiki server itself or to a private network.
Too many redirects when trying to reach [<url>]RSS Display 15.7+ The URL redirects more than 5 times.
Failed to retrieve the feed from [<url>]RSS Display 15.7+ The URL cannot be fetched (for example an unknown host, a 404 or no answer within 5 seconds), retrieving it takes more than 10 seconds, the feed is larger than 5 MB, or what it returns is not a feed. The exact cause is logged at DEBUG level by the org.xwiki.contrib.rssdisplay.internal.DefaultRomeFeedFactory logger.
No feed found at [<url>]The URL returned no feed.

RSS Display <15.7 A server that did not answer within 5 seconds was reported as Connection timeout when trying to reach [<url>], and the other failures as Error processing [<url>] : <cause>.

Parameters

NameMandatoryAllowed ValuesDefault ValueDescription
feedyesa URLnoneThe URL of the RSS feed.
countnoa positive integer10The maximum number of entries to display.
contentnotrue, falsefalseWhen true, displays the content of each entry under its title.
imagenotrue, falsefalseWhen true and the feed declares an image, displays that image at the top of the box.
decorationnotrue, falsetrueWhen true, frames the entries in a box topped by the feed's title and an RSS icon. When false, displays only the list of entries.
widthnoa CSS width, in px or %the full width of the pageThe width of the box.
titlenowiki contentnoneDisplayed at the top of the box, above the feed's title.
cssClassnoa space-separated list of CSS class namesnoneAdded to the classes of the box, so this feed can be styled on its own.
encodingnoa character encoding name, such as UTF-8guessedThe encoding used to read the feed. By default it is guessed from the feed's byte order mark and XML declaration; set it when the feed displays garbled characters.

Examples

Entries Without Decoration

{{rss feed="https://forum.xwiki.org/latest.rss" count="3" decoration="false"/}}

Three links to the latest XWiki forum topics, without a box or a feed title

Feed Image and Entry Content in a Narrower Box

{{rss feed="https://www.flickr.com/services/feeds/photos_public.gne?format=rss_200&tags=xwiki" image="true" content="true" width="50%" count="1"/}}

A half-width box showing the feed's image, its title, one photo entry title and the photo below it

A Custom Title and an Introduction

{{rss feed="https://forum.xwiki.org/latest.rss" count="5" title="**XWiki forum**" cssClass="news"}}
The latest topics of the XWiki forum.
{{/rss}}

Related

Get Connected