More in this section

Forums / Developing with Sitefinity / Create custom News module

Create custom News module

3 posts, 0 answered
  1. Frederico Fernandes
    Frederico Fernandes avatar
    29 posts
    Registered:
    27 Oct 2009
    27 Nov 2009
    Link to this post
    Hello, i want to create my ControlPanel for news, i extend the news module but my controlpanel does not appear  when i do the debug only appear your controlpanel news. Any help ??
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    27 Nov 2009
    Link to this post
    Hello Frederico Fernandes,

    You need to create a new module that inherits from NewsView and override CreateControlPanel and return your CustomNewsControlPanel:

    Sample code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.News;
    using Telerik.News.WebControls.Search;
    using Telerik.Framework.Search;
     
    /// <summary>
    /// Summary description for NewsModuleCustom
    /// </summary>
    public class NewsModuleCustom : NewsModule, IIndexingSupportModule
    {
        public NewsModuleCustom()
        {
        }
     
        public override string Title
        {
            get
            {
                return "NewsModuleCustom";
            }
        }
     
        public override string Name
        {
            get
            {
                return "NewsModuleCustom";
            }
        }
     
        public override System.Web.UI.Control CreateControlPanel(System.Web.UI.TemplateControl parent)
        {
            return new NewsCustomControlPanel();
        }
     
        IServiceClientInfo[] IIndexingSupportModule.GetSeviceClients()
        {
            return new IServiceClientInfo[]
                {
                    new IndexingServiceClientInfo("NewsCustomIndex"
                        , typeof(NewsIndexProvider)
                        , typeof(NewsIndexSettingsControl).FullName
                        , typeof(NewsIndexViewControl).FullName
                        , "NewsCustomIndexProvider"//TODO:Get it from resources
                        )
                };
        }
     
    }

    our ControlPanel

    public class NewsCustomControlPanel : NewsControlPanel
    {
        public NewsCustomControlPanel()
        {
     
        }
     
        public override Type LocalizationAssemblyInfo
        {
            get
            {
                return GetType();
            }
            set
            {
                base.LocalizationAssemblyInfo = value;
            }
        }
     
        public override Type AssemblyInfo
        {
            get
            {
                return GetType();
            }
            set
            {
                base.AssemblyInfo = value;
            }
        }
     
    }

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Frederico Fernandes
    Frederico Fernandes avatar
    29 posts
    Registered:
    27 Oct 2009
    27 Nov 2009
    Link to this post
    Tanks Ivan it works :)
Register for webinar
3 posts, 0 answered