Kentico CMS 7.0 Developer's Guide

RSS repeater + Data source

RSS repeater + Data source

Previous topic Next topic Mail us feedback on this topic!  

RSS repeater + Data source

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

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.

 

 

 

Please 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).

 

 

1. Sign in to CMS Desk and select the Forums page from the content tree. Click New and choose the Page (menu item) document type.

 

devguide_clip1010

 

2. Choose the Create a blank page option. Enter RSS as the Page name and click Save.

 

devguide_clip1011

 

3. The page opens in Design mode. Click the Add web part (AddWebPart) icon of the only web part zone on the page. Select the Data sources/Forum posts data source web part and click OK. 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.

 

4. Click the Add web part (AddWebPart) icon again and select the Syndication/RSS repeater web part. Click OK and enter the following in the Web part properties dialog:

 

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.

 

devguide_clip1012

 

5. The RSS feed is now ready. To allow visitors to access the feed, create a link using the Feed link web part, which displays the RSS icon with a link leading to a URL specified in its properties.

 

Select the /Forums page in the content tree, switch to the Design mode and click the Add web part (AddWebPart) icon of the Content zone web part zone. Select Syndication/Feed link and click OK. Enter 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.

 

6. Sign out of CMS Desk and browse to the Forums page. You should see the RSS icon and link.

 

devguide_clip1007

 

7. Click the icon or 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.

 

devguide_clip1013