Sep
29
I have had multiple clients over the past couple of years task me with getting external RSS feeds on their WSS sites. While MOSS comes with an RSS Feed web part, and while there are other RSS Feed web parts out there for free or a nominal fee, I though I would make a post about the two most common ways I have implemented RSS Feeds onto a WSS page or site.
Method 1 – The XML Web Part
1. Navigate to the page where you would like to show an RSS Feed.
2. Click on Site Actions, then Edit Page.
3. Click the Add a Web Part link in the zone where you would like to add the RSS Feed.
4. Under All Web Parts | Miscellaneous, select the XML Web Part and then click the Add button.
5. Click the open the tool pane link in the web part.
6. Enter the RSS Feed URL in the XML Link field.
7. Click the XSL Editor button.
8. Add the following code:
<xml version="1.0" encoding="UTF-8"> <xsl:stylesheet><br version="1.0" /> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl"> <xsl:output indent="yes" omit-xml-declaration="yes" method="xml" /> <xsl:template match="/"> <xsl:apply-templates select="rss/channel" /> </xsl:template> <xsl:template match="rss/channel"> <xsl:variable select="link" name="link" /> <xsl:variable select="description" name="description" /> <ul><xsl:apply-templates select="item" /></ul> </xsl:template> <xsl:template match="item"> <xsl:variable select="link" name="item_link" /> <xsl:variable select="description" name="item_title" /> <li> <a title="{$item_title}" href="{$item_link}"><xsl:value-of select="title" /></a><xsl:value-of select="description" /> </li> </xsl:template> </xsl:stylesheet>
9. Expand the Appearance node and enter your desired web part title in the Title field.
10. Click the OK button.
11. You are done. The RSS Feed should not be displayed on the page as a series of bulleted items.
Method 2 – Using the Data Source Library and DataForm Web Part in SharePoint Designer
1. In SharePoint Designer, open the page where you would like to add the RSS Feed.
2. Click on the name of the web part zone where you would like to add the RSS Feed.
3. In the Data Source Library dialog, expand the Server-side Scripts node and click on Connect to a script or RSS feed…
4. On the General tab, enter a Name and/or Description.
5. On the Source tab, enter the RSS Feed’s URL in the Enter the URL to a server-side script field.
6. If authentication is required for your RSS Feed, enter the authentication information on the Login tab.
7. Hover over your newly-formed Data Source, click the down arrow to enable the hover menu, and select Show Data.
8. Browse down to the Item node and select the title field. Hold down the Ctrl key and then select the description field.
9. Click on the Insert Selected Fields As button and then click Multiple Item View.
10. You are done. The RSS Feed should now be displayed on the page.
NOTES:
You can click the small arrow in the top right of the newly-created DataFormWebPart and then select Change layout to choose different display options for the web part. I normally use the second one on the list, as that is a slightly cleaner display.
You can also make it a little more practical by enabling the title to link to the original post on the site that generated the RSS Feed. Do this by hovering over the title of the first RSS Feed entry and clicking the small arrow and then selecting Hyperlink in the Format as field. In the Hyperlink dialog, make sure that the Text to display field says {title} and the Address field says {link}.
The last tweak is to get rid of the “description:” text – remove it with your keyboard for the first RSS Feed entry and it will be removed for all entries.
I hope this is a little useful to some of you. Thanks.


Method 1 does not work
help?
First method just broke my template :S
Like it’s was got all page, and removed the right tool bar