More in this section

Forums / Developing with Sitefinity / rss customisation

rss customisation

5 posts, 0 answered
  1. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    10 Oct 2008
    Link to this post
    hi guys!

    i'd like to be able to customise the way in which rss feeds are written out slightly. specifically i would like to be able to add a link back to our site at the bottom of every story in the rss feed.

    i do not need any functionality other than this. from my research i have realised that to get this functionality i would have to extend numerous classes - which would prove cumbersome and laborious. am i missing something here, or is this the only way in which i can go about this?

    cheers again guys, your help is always appreciated!
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    13 Oct 2008
    Link to this post
    Hi Nick,

    We replied in your other thread about the same inquiry.
    Please feel free to ask us about anything you would like to know about Sitefinity.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    13 Oct 2008
    Link to this post
    sorry about the double posting, it was one of my colleagues posting (i had not realised he had posted regarding RSS when i also posted about it)

    thanks for the help anyway!
  4. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    13 Oct 2008
    Link to this post
    sorry to crosspost but if you do want to get started on this I've had some experience with this which you can check here: http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bgcagk.aspx which talks about rss feeds for custom modules.

    I've also posted a new blog series in that thread above on how to make an rss feed for the generic content module including podcasts...

    for your specific needs, I'm assuming this is the blogs rss feed? you could probably just reate a class inheriting the blogs rss channel provider and override just the one method that builds the rss items, appending your link to each item:

    public override IList<RssItem> GetRssItems(System.Collections.Specialized.NameValueCollection query)  
    {  
        IList<RssItem> rssItems = base.GetRssItems(query);  
        foreach (RssItem item in rssItems)  
        {  
            item.Description += "<p>YOUR LINK GOES HERE</p>";  
        }  
        return rssItems;  

    I haven't tried this but it's the same approach I used to do the stuff I linked above, so it's probably a good place to start! All you'd have to do next is update the rssProviders entry for Blogs in web.config to point to this new class instead of the default one.

    hope this is helpful!
  5. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    13 Oct 2008
    Link to this post
    thanks for the reply selArom!

    i did see your thread on RSS feeds (i thought my luck was in when i came to the forum to post about RSS only to see your post sitting right at the top), but it seems you were doing something a lot more complex than i plan(ned)

    i have (as you describe on your blog) used .net reflector to inspect the code regarding other RSS feeds within sitefinity. i too tracked down the method you pointed out below and identified it as the method which i must override to provide the small and simple additional functionality i require.

    however the class regarding rss feeds is originally referenced in the web.config. from here quite a large chain of classes are used until eventually  ending up at the method which you pointed out in your post above.

    so to get my overriden method to be called at the end of the rss feed creation, i would have to extend every class in this chain, and override every method in the chain, in order to point from start to end to my new method (for example, i would have to override the method which calls the original GetRssItems(...) method to point to my new overriden GetRssItems(..) method, then override the method that calls this method and so on and so forth)

    am i mistaken in believing that this is how i would go about this (this seems the simplest way to do it). and although it seems simple, it would be a very mundane job!

    cheers for any help guys :-)
Register for webinar
5 posts, 0 answered