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

Forums / Developing with Sitefinity / Customized News module

Customized News module

6 posts, 0 answered
  1. Hydo L
    Hydo L avatar
    98 posts
    Registered:
    31 Mar 2010
    05 Aug 2010
    Link to this post
    Hi,

    How can I add new pdf upload field in the news module.

    I also need a download Link in the Front end News details page to download the corresponding PDF 

    Regards,
    Hydo
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Aug 2010
    Link to this post
    Hi Hydo L,

    You have to add a custom metafileds for News module. You can use ButtonSelector control to set the path from the backend when you create or update a news item. Then create a custom class that inherits from NewsView - public control that shows news items. Override SetItemMetadata method from where you can set your metakey. In the public control template - ListPageMaster or ListPageDetails you can add HyperLink control which will show the download link that points to the file you want to access.

    Sincerely yours,
    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. Hydo L
    Hydo L avatar
    98 posts
    Registered:
    31 Mar 2010
    08 Aug 2010
    Link to this post
    Thanks Ivan
  4. Hydo L
    Hydo L avatar
    98 posts
    Registered:
    31 Mar 2010
    17 Aug 2010
    Link to this post
    Hi Ivan,

    It will be very helpfull if you can provide a sample code for this, especially for class.

    Many thanks,
    Hydo
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Aug 2010
    Link to this post
    Hello Hydo L,

    Here is a sample code

    public class NewsViewCustomControl : NewsView
    {
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx";
            }
     
        }
     
        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx";
            }
     
        }
     
     
        public override Type LocalizationAssemblyInfo
        {
            get
            {
                return this.GetType();
            }
            set
            {
                base.LocalizationAssemblyInfo = value;
            }
        }
     
        public override Type AssemblyInfo
        {
            get
            {
                return this.GetType();
            }
            set
            {
                base.AssemblyInfo = value;
            }
        }
     
        protected override void SetItemMetadata(Control itemContainer, IContent contentItem)
        {
            base.SetItemMetadata(itemContainer, contentItem);
         // here you can find any control inside the repeater
             
             
        }
    }


    Regards,
    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
  6. Hydo L
    Hydo L avatar
    98 posts
    Registered:
    31 Mar 2010
    18 Aug 2010
    Link to this post
    Thanks Ivan
Register for webinar
6 posts, 0 answered