More in this section

Forums / Developing with Sitefinity / Inherit an existing module

Inherit an existing module

2 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    18 Feb 2004
    15 May 2008
    Link to this post
    Hi telerik,

    I have quite some changes I'd like to do on  the newslist and singlenews modules.

    Is it possible to inherit (or copy) the existing news module(s) to make the changes in the copies instead of the originals? Otherwise when there is an update, all my changes would be overwritten.

    I was thinking of creating new usercontrols for my newslist etc., but that would mean I have to build them from scratch. Hopefuly there is a better and faster way to do this?

  2. Ivan
    Ivan avatar
    478 posts
    16 Jun 2015
    15 May 2008
    Link to this post
    Hi Daniel,

    if the only thing you want to change are public controls (NewsList and SingleNews) it is not needed to inherit a module (though this is possible - e.g. News module inherits Generic Content module).

    All you need to do is create new controls and this you can do in following ways:
    - Create a completely new control and use NewsManager class (API for News module) to get the data.
    - Inherit NewsList control and modify it.
    - Inherit ContentView control and modify it (ContentView control was actually created as a base class for public controls of all modules whose public controls are based on Generic Content, such as News, Blogs, Events...)

    I suggest you opt for the third approach as it will give you the best value between reusability and flexibility. However, bear in mind that we are working on the new public control for News List module (NewsView) which is going to be based on ContentView control, unlike NewsList and SingleNews which are obsolete (but we are going to keep them around for some time).

    Let me know if you have any additional questions.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered