More in this section

Forums / Developing with Sitefinity / Extending the Forum Single Thread Control

Extending the Forum Single Thread Control

4 posts, 0 answered
  1. Chris Trinder
    Chris Trinder avatar
    2 posts
    Registered:
    26 Oct 2009
    26 Oct 2009
    Link to this post
    Hi. I'm VERY new to SiteFinity and the how it has been structured, but I need to add some additional functionality to the Single Thread, forum control. In short I need to add a couple of buttons that allow the users to vote against each post to say whether they agree/disagree with what was said. I initially assumed that I could make a copy of the user control; "SingleThread.ascx" and inherit from the original codeBehind class, then add my own buttons and methods. However, I have since realised that there is no such codeBehind - which leaves me thinking that SiteFinity adopts a sort of MVC approach? If so, what is the best way to take the current functionality of the SingleThread control and merely add new functionality around it? Many thanks in advance for your help. Chris
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Oct 2009
    Link to this post
    Hi Chris Trinder,

    You can create a code behind of the template or write inline code. You need to create a custom table in your database where you need to store the username and post ID. Thus you will be able to persist  agree/disagree values.

    Kind 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. Chris Trinder
    Chris Trinder avatar
    2 posts
    Registered:
    26 Oct 2009
    26 Oct 2009
    Link to this post
    Thanks for your VERY prompt reply! Creating a codeBehind file for my new control is exactly what I want to do, but I wanted to inherit the original functionality. I thought the following class would be the correct class to inherit from;
    Telerik.Forums.WebControls.SingleThread

    ...but it isn't of the type; UserControl. Therefore, I can't inherit from that on my UserControl codeBehind. Am I looking in the wrong place completely? Perhaps I am trying to use a different design practice to how SiteFinity has been built? I would appreciate your help on getting started with this modification... the changes to table structures and store procedures are all relatively straight-forward, I just don't want to have to write all the SingleThread logic again for my own control.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Oct 2009
    Link to this post
    Hi Chris Trinder,

    You cannot inherit from Telerik.Forums.WebControls.SingleThread, because SingleThread.ascx is a template of a view that is built into Telerik.Forums.dll. You can create a code behind of the template and subscribe for some events of the Grid or Repeater inside you should add your "agree/disagree" buttons. The Forums module is not generic content based module and its Views cannot be replated as you can do for the other modules. This means that if you want to make general custumizations you should create a new module and inherit from the base classes.

    Also I suggest that you should go through our DevelopersManual - Forums API.

    All the best,
    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.
Register for webinar
4 posts, 0 answered