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

Forums / Developing with Sitefinity / Rss feed - Title unknown with new Title field

Rss feed - Title unknown with new Title field

5 posts, 0 answered
  1. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    31 Oct 2010
    Link to this post
    Hi,

    I have used a Long Title field to save arabic unicode characters in LongText datatype, all is good except that the Rss shows (Unknown) for the Title, I found a key in webconfig to have the rss read the new title field but its not taking any effect, can you please tell me how to fix that. Thanks

    -Z
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Oct 2010
    Link to this post
    Hi Zubair,

    The name of your metakey should be either "Title" or "Name". If the name of your metakey is different you can see "undefined" as a title. If you want to use another metakey you need a custom Rss provider that inherits from RssChannelProvider ( or the provider you use  - Blogs, Events,News) and you should override SetTitle method

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.News.Rss;
     
    /// <summary>
    /// Summary description for Class2
    /// </summary>
    public class Class2 : RssChannelProvider
    {
        public Class2()
        {
           
        }
     
        protected override void SetTitle(Telerik.Rss.RssItem item, Telerik.Cms.Engine.IContent content)
        {
            //base.SetTitle(item, content);
            var t = content.GetMetaData("CustomTitle").ToString();
            item.Title = t;
        }
    }


    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    01 Nov 2010
    Link to this post
    Hi,

    Could you please provide a full code to fix this title issue in Sitefinity. Thanks.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Nov 2010
    Link to this post
    Hi Zubair,

    This is not an issue of Sitefinity. The problem is that you are not using a proper field.

    1. Create a custom class that inherits from RssChannelProvider as shown in the previous reply.
    2. Override  SetTitle and use your custom metakey there. You should not add any additional code than what is shown in the previous reply.
    3. Register you custom provider inside the web.config

    sample

    <rss defaultProvider="Sitefinity">
                <feeds>
                </feeds>
                <channelProviders>
                    <clear/>
            <add name="Custom Rss Provider" type="ExtendedRssChanelProvider, App_Code" settingsControl="ExtendedRssSettignsControl, App_Code" viewSettingsControl="ExtendedRssViewControl, App_Code" description="extended RSS provider for blogs"></add>
            <add name="Page Rss Provider" type="Telerik.Cms.Web.RssChannelProvider, Telerik.Cms" settingsControl="Telerik.Cms.Web.UI.RssSettingsControl, Telerik.Cms" viewSettingsControl="Telerik.Cms.Web.UI.RssViewSettingsControl, Telerik.Cms" description="Provides RSS for CMS pages"/>
                </channelProviders>

    settingsControl and viewSettingsControl could be the default one for the base module.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    01 Nov 2010
    Link to this post
    Hi Ivan,

    Appreciate the steps for implementing the Custom Rss provider, will implement them at work and get back.

    Thanks,

    -Z
Register for webinar
5 posts, 0 answered