Usage example - RSS repeater + Data source
The RSS repeater web part allows you to transform pages into RSS feeds. When a page containing the web part is accessed, the response type is changed to application/xml and the page renders the content of the feed. This is useful if you want your feed to have a dedicated URL, without the need for a querystring parameter. The Atom repeater and XML repeater web parts can be used exactly the same way, but the rendered feed is in the Atom or XML format.
The following example demonstrates how to create an RSS feed containing the data of forum posts on the sample Corporate site. The example uses a dedicated feed page containing the RSS repeater web part.
Note
The result of the following example can also be achieved using a single web part - the Forum posts RSS feed web part, which has a built-in Forum posts data source. Similarly, there are all-in-one web parts for other frequently used document types and objects (see the list in Syndication web parts and widgets).
Create a page containing the Forum posts data source web part:
- Open the Pages application.
- Select the Community -> Forums page in the content tree.
- Click New () and choose the Page (menu item) document type.
- Type RSS as the Page name and choose the Create a blank page option.
- Click Save.
- Open the Design tab.
- Add the Forum posts data source web part.
- Leave all properties at the default values, which causes the data source to load all forum posts from all forum groups on the site.
- Click OK.
Add the second web part:
On the Design tab, add the RSS repeater web part onto the page.
Set the following properties:
- Feed name: MyForumPostsFeed
- Feed title: Corporate Site Forum Posts
- Feed description: This is a sample feed of all forum posts on the Corporate Site.
- Data source name: ForumPostsDataSource
- Transformation name: CMS.RSSTransformations.ForumPosts
Leave defaults for the rest of the properties and click OK.
The RSS feed is now ready. To allow visitors to access the feed, create a link using the Feed link web part:
In the Pages application, select the Community -> Forumspage.
Switch to the Design tab.
Add the Feed link web part.
Set the following properties:
- Link text: Forum posts RSS feed
- Feed URL: ~/Community/Forums/RSS.aspx
- Feed title: My Forum Posts Feed
Leave defaults for the rest of the properties and click OK.
The Feed link web part displays the RSS icon with a link leading to the specified URL.
If you view the Community -> Forums page on the live site, you can see the RSS icon and link.
If you click the link, your browser detects that you are accessing an RSS feed and displays the content. The URL of the feed matches the URL of the page containing the RSS repeater web part. You can use the same URL to access the feed from both browsers and dedicated RSS reader programs.