Display items from external RSS feed?

Posted by Community Admin on 03-Aug-2018 21:46

Display items from external RSS feed?

All Replies

Posted by Community Admin on 11-May-2012 00:00

Our client would like to display items from an external RSS feed in the sidebar on a page of their site. Is there a control that will do this?

Posted by Community Admin on 11-May-2012 00:00

I stopped looking for a control and built a very simple one that uses an XMLDataSource and DataList. Works great.

Posted by Community Admin on 21-Aug-2012 00:00

+1 I would find this great out-of-the-box functionality also.

Drew Robson ssw.com.au

Posted by Community Admin on 21-Aug-2012 00:00

Hi,

XMLDataSource control will really be a very good choice in displaying any RSS feed in user control
ascx.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="XML.ascx.cs" Inherits="SitefinityWebApp.Custom.XML" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
<asp:XmlDataSourceID="XmlDataSource1"runat="server">
  
</asp:XmlDataSource>
  
<asp:RepeaterID="Repeater1"runat="server"DataSourceID="XmlDataSource1">
  
<ItemTemplate>
<%#XPath("link")%>"> <%#XPath("title")%>
  
</ItemTemplate>
  
<SeparatorTemplate>
  
<hr/>
</SeparatorTemplate>
  
</asp:Repeater>

Code behind:

           XmlDataSource1.XPath = "rss/channel/item";
           XmlDataSource1.Data= "XmlDataSource1";
           XmlDataSource1.DataBind();
also you can consume RSS feed from Sitefinity and publish it as Sitefinity content.

Regards,
Stanislav Velikov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 11-Jul-2013 00:00

Stanislav, tnx for the details.  Just tried this and it works fine.  Though, for others, there were a few typos that should be addressed if you copy/paste from the post above.

<asp:XmlDataSourceID="XmlDataSource1"runat="server">  //need space between XmlDataSource and ID.

<asp:RepeaterID="Repeater1"runat="server"DataSourceID="XmlDataSource1">  //same, need space betwen Repeater and ID.

<%#XPath("link")%>"> <%#XPath("title")%>  //Extra "> after the "link" xpath.

Here's similar code with slight adjustments:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="XML.ascx.cs" Inherits="SitefinityWebApp.Custom.XML" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
   
<asp:XmlDataSource ID="XmlDataSource1" runat="server"></asp:XmlDataSource>
<asp:Repeater id="Repeater1" runat="server" DataSourceID="XmlDataSource1">
<ItemTemplate>
<h2>
   <%#XPath("title")%>
</h2>
    <strong><%#XPath("pubDate")%> </strong><br />
    <br />
  <a href="<%#XPath("link")%>">Read Full Story >> </a>
</ItemTemplate>
<SeparatorTemplate>
<hr/>
</SeparatorTemplate>
</asp:Repeater>

Posted by Community Admin on 24-Mar-2014 00:00

Please vote for this feature request if you think 'Rss feed reader control' should be an out of the box feature in future revisions of Sitefinity.

 http://feedback.telerik.com/Project/153/Feedback/Details/123666-rss-feed-reader-control

 Thanks

Posted by Community Admin on 25-Mar-2014 00:00

I have used the approach the approach Stanislav Velikov mentioned, where you consume an RSS feed from Sitefinity and publish it as Sitefinity content. That approach worked very well for my needs. The key settings to look at are:

  • Content to include: Set this to "www.eyefootball.com/rss_news_main.xml"
  • Publish as: This is where you set it to the Sitefinity artifact you want to import the content to. In my case I published it as Sitefinity news.

You can then schedule the import to occure daily, hourly ect. The reason I like this approach is that if the external feed goes down your site will still be able to display the already imported feeds.

 

 

 

This thread is closed