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

Forums / Bugs & Issues / RSS Feeds sorting issue in Sitefinity V3.5

RSS Feeds sorting issue in Sitefinity V3.5

8 posts, 0 answered
  1. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    13 May 2009
    Link to this post

    Hi

    I use sitefinity 3.5

    I have created Feeds for my news content. I see that RSS feeds are not sorted by published date. I read in number of other threads relative to this issues and found that Sitefinity 3.5 RSS creates feeds based on creation date.

    To test that, i created a new RSS feed fetching only 5 items at a time. I created 5 new news items and 3 were already existing (created before a month).
    But i find rss feeds still displays old 3 news items and 2 new news items.

    What i want now is to know the created date of old news items. How do i find it?

    Ps: I checked in history and the create date is last month. I restarted my application several times to clear cache (if any). I tested same scenario by creating feeds for different news categories.

    Reference links:

    RSS FEED date reset
    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bmgdca.aspx

    Sort order issue
    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-begtga.aspx

    Thanks
    Durga N

  2. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    13 May 2009
    Link to this post
    Hi

    One more info request. If at all creation date of old items is different and if i wanna reset.. is it possible? if yes can you tell how to do.

    Thx
    Durga N
  3. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    16 May 2009
    Link to this post
    Hi Durga,

    First, let me tell you that RSS feeds are sorted by name out of the box in Sitefinity 3.6 SP1 (for more information see Sitefinity 3.6 Service Pack 1).

    What is more important, this version includes a new overload of the GetAllFeeds method which accepts sorting expression as a parameter:
    public IList GetAllFeeds(string sortExp) 
    {...} 

    As to finding out the creation date of a news item, I am afraid you could not do that. Here is more on working programmatically with News items: News API Walkthrough . This article lists all available meta keys for the News module which does not include creation date. This means that you could only reference them using publication date.

    In your scenario, you could check whether the publication date is, for example, from the last month and then accept the news items for the RSS.

    As to the question from your second post, I am sorry to say I do not understand it. Please provide more details so that we could help you.

    Let us know if there has been any misunderstanding.

    Sincerely yours,
    Sonya
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  4. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    17 May 2009
    Link to this post
    Hi
    Thanks for your reply. I am using Sitefinity 3.5.1747.2:1 and i have not written any custom code to extend or filter RSS feeds based on publication date. And i can not migrate my site to Sitefinity 3.6 at this point of time.

    With this situation, as explained in my first post, in my website RSS feed items are not getting sorted based on publication date. Could you please tell me if there is any workaround to make it sorted based on publication date in Sitefinity 3.5 version.

    About my second question (in my second post),
    In http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-begtga.aspx, there is a reply from Telerik support saying 'the rule for the sorting of the RSS items is by creating date and for the time being there is no way to change this behavior'. so I wanted to know if i can reset the 'creation date' of News items through any means. But i got it answered from your reply saying it is not possible.

    Thanks in advance for your support.

    Regards
    Durga N

  5. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    19 May 2009
    Link to this post
    Hi Durga,

    In regards to your second question, my reply was that there is no creation date used for the news module - the date of introduction of the item is production date. That said, you could manipulate that date in different ways, such as if you use the SetMetaData method to change the value of the publication date for a given news item.

    This is shown in the following example:
    Telerik.News.NewsManager newsManager = new Telerik.News.NewsManager("News"); 
     
    IList listOfNewsItems = newsManager.Content.GetContent(); 
    if (listOfNewsItems.Count > 0) 
        foreach (Telerik.Cms.Engine.IContent newsItem in listOfNewsItems) 
        { 
            DateTime newsItemPublicationDate = (DateTime)newsItem.GetMetaData("Publication_Date"); 
     
            DateTime limitDate = (DateTime.Now).AddMonths(-3);
     
            if (DateTime.Compare(newsItemPublicationDate,limitDate)<0) 
                newsItem.SetMetaData("Publication_Date", DateTime.Now.ToString()); 
        } 

    Here, we take all news items and compare them with a date that is used as a limit (3 months ago). If they are published earlier than the given date, we save their publication date to be today - this ensures that they will not be taken by the RSS feeds.

    Still, I do not understand what you mean by resetting - you would like to permanently change the value of the publication date for some items, or you would like to change the meta data for some news items only so that the RSS module ignores them but without actually saving that meta data?

    We reproduced the behavior you described with the publication date of the news items and how they are displayed in the RSS feed. This is a bug for 3.5 and it is fixed in 3.6 - the feed shows the latest items and it gets them by publication date - the exact behavior you need. Unfortunately, we could not provide a workaround for this problem and we could only recommend an upgrade. We could assure you that if you choose that option, we will provide you with extensive assistance to go through that process. This is also a very good investment for almost-painless upgrades after that (usage of external templates).

    Let us know if we could help any further.

    All the best,
    Sonya
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    20 May 2009
    Link to this post

    Hi

    Thanks for your reply.
    I can understand that the issue i am facing is a bug with sitefinity 3.5. But i can not migrate to sitefinity 3.6 very easily as it is upto my organisation to decide. so i have let them know about this.

    Clarification about resetting publication date : If the problem i face is because of publication date, i would like to try to change the publication date of the news items permenantly to some date earlier (ex: if date is today 20-May-2009, i will change it to 20-May-2008) so that RSS service will not pick that news item.

    In a way i am not really convinced about the ordering of news items in RSS feeds is based on Published date. This is because i can see the ordering in RSS xml in my website is not by Publication date, but based on something else which i do not understand.

    With this, I will stop searching for a easy solution now for my issue :).

    But, can you help me in finding detailed instructions for implementing the code you suggested in your reply,  as the instructions \ information in developer's manual is not sufficient for me to exercise it. (http://www.sitefinity.com/help/developer-manual/services-rss-implementing-rss-functionality.html). I created classes as specified in the developer's reference and put in app_code, but didnt get it working.

    If i can get detailed instruction, I can try again and keep it as a backup option if it takes time to migrate the website to Sitefinity 3.6

    Thanks again for you support.

    Regards
    Durga N

  7. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    21 May 2009
    Link to this post
    Hi

    Thanks to SelArom, i was able to create a intra-site module (for the first time) which will get NewsItems based on my requirement, sort in the order that i want and generate RssFeed items.

    I simply followed the steps in SelArom's thread (http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bgcagk.aspx) and 'Implementing RSS functionality' section in developer's manual.

    I am yet to complete full implementation. But i have few questions here.

    1. My intention is to create an intra-side module that will make use of Sitefinity's builtin RSS functionality. I will define GetRSSItems function (similar to the one described in Developer's manual > Developing with Sitefinity > Services > RSS Service > Implementing IRssProvider ) to return News feeds.
    I want to know if this implementation is correct?

    2. I created Provider, Module, Settings and Viewcontrol classes in my new module, put it under 'App_code' folder, registered it in web.config file (as described in Developer's manual > Developing with Sitefinity > Modules > Adding New Modules to Sitefinity > Intra-site Modules > Intra-Site Module with LINQ Provider ). There is no compilation error because my site is opening correctly. But i dont see my new intra-site module visible in Sitefinity admin webUI. Can you help me in knowing what the reason could be.

    If needed, i can share new module code that i have created (though i have coded now to return only empty feed item)

    Thanks in advance for support.
    Regards
    Durga N




  8. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    26 May 2009
    Link to this post
    Hello Durga,

    Please excuse us for the delay in our response. Here are answers to your questions:

    1. Yes, the example should work correctly. Let us know if you need help with that example.

    2. Did you try the simplest intra-site example? Do you have any problems with it? I recommend you to do it first if you have never created an intra-site module before because this example will provide you with basic knowledge of this type of Sitefinity modules and it will be much easier for you to modify it later to meet your module requirements.

    As to the Linq Provider example: did you implement all steps described in the article, using the provided code? If yes, I will ask you to provide your implementation so that we could test it locally to find out where the problem is coming from.

    Sincerely yours,
    Sonya
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
8 posts, 0 answered