+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom News Provider Example

Custom News Provider Example

4 posts, 1 answered
  1. Josh
    Josh avatar
    16 posts
    Registered:
    15 May 2012
    11 Nov 2013
    Link to this post
    Hello,

    My company partners with a news curator who has an API available to retrieve articles via REST calls. I'd like to show these in Sitefinity with our other articles in the news widget, but I don't actually need to persist them in the database.

    Is it possible to create a "read-only" news provider to integrate with Sitefinity? If so, does anyone have a complete example? Or do you think it would be easier/better to simply build a custom control that pulls from both places?

    Thanks!
  2. Jonathan
    Jonathan avatar
    119 posts
    Registered:
    19 Dec 2012
    11 Nov 2013 in reply to Josh
    Link to this post
    Might be a appropriate to build a MVC widget where the controller grabs from both APIs and creates a common Model of the two.
    Answered
  3. Josh
    Josh avatar
    16 posts
    Registered:
    15 May 2012
    21 Nov 2013 in reply to Jonathan
    Link to this post
    Thanks Jonathan, that's what I ended up doing.

    I still think it would be helpful to have an example of a complete custom news provider, so if anyone stumbles across this thread and has one to share I'd appreciate it.
  4. BoaMike
    BoaMike avatar
    51 posts
    Registered:
    25 Sep 2009
    30 Nov 2013
    Link to this post
    I think what you probably want is a custom pipe.  You can create a custom pull pipe with pass through to the publishing point.  Using a pull pipe with pass through, you can display external data (such as an RSS feed) but don't persist the data in the database.  This blog post has an example project attached that demonstrates what's involved in creating a custom pipe.  Custom Pipe Example.  The example project isn't all that similar to what you're trying to do, but hopefully there's enough general info on custom pipe implementation for you to see if it would work for your needs and what would be involved.
4 posts, 1 answered