Sitefinity ASP.NET CMS - Content Management System

KB Article

Home >  Support >  Knowledge Base >  KB Article
Using the different Forums module controls - ID#842
Rating:
Last Modified: 1/25/2008
Related categories: Modules;

Article information

Article relates to

 Sitefinity 3.1 Forums Module

Created by

 Slavo Ingilizov


Among the many other goodies and new features included in Sitefinity 3.1 is the long awaited Forums module. It provides a standard discussion board for your site where users can post their opinions on different topics. Each forum can be assigned to a particular category (note that forum categories are different from the ones used for Generic Content based modules). A single forum contains a number of threads, and each thread by itself has a number of posts. The thread is a topic started by a single user of your website, and the posts in it are the comments of other users on that topic.

In order to achieve the functionality described above, five controls are available for use in the Forums section of Sitefinity’s toolbox: Forums, Forum List, Single Forum, Single Thread and Edit Post. If you are using the Forums public controls in your site, make sure you add a script manager in your .master file as shown below:
   <asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>
This is required since the introduction of RadEditor Prometheus.

Sitefinity tries to find the balance between end users and developers. In other words, it tries to provide a good level of extensibility and at the same time be easy enough for people who do not want to touch code. This was the main consideration when we decided to provide different public controls for Forums. In fact, having these different controls gives you the ability to extend and modify the usability and layout of Forums in your site. Here’s how to do it.

A user of the forums on your site can be in one of several so-called “states” at a time, as the diagram below shows.


Transitions between those stages occur when the user performs a certain action, indicated on the arrow showing the transition. For example, the user goes from the Single Forum to Single Thread state when s/he opens a thread.

The different public controls for Forums serve to provide the functionality needed at each of these states. Every control provides functionality for the state with the corresponding name.

You may be wondering what the Forums control does then. The simple answer is that it does everything and knows everything. It performs its magic by combining the functionality of all the other controls. In fact, you can almost do magical stuff with this control: you drop it on a page and, voila, you have forums for your site. Of course, you would need to create the forum from the administration part in order to have something to display. By default the Forums control can play the game alone and does not need any special configuration to do so. But at some point, a moment comes when you need more extensibility. Say you like the page for the Single Thread state which displays all posts in a thread… save for one thing. You would love to have an FAQ section on the side, which tells users what they can post and how they can do it, similar to the picture below.


Now the Forums control works no more, as it knows only its own way of showing the Single Thread state and would not hear about any FAQ section. Then what you do is create another page, drop a Single Thread control on it, and create an FAQ section on the side, as another control on the page, probably showing a list. The only thing remaining is to tell the Forums control is that somebody else is going to take over the display of the Single Thread state, and also tell the Single Thread control to go to the Forums control for anything else it needs, like say, creating a reply. All the forums controls have properties which control where flow goes when a certain action occurs. For example, the SingleThreadPage property of the Forums control gives the URL of the page, containing the control that takes care of the Single Thread state. This is the way to tell a control that a particular state is handled somewhere else. These properties must be set for all controls except Forums. This is because it can take care of everything. If the property is not set, it assumes no one else wants to take over and does the job itself. Using all these page URL properties, you can create any combination of controls communicating with each other from different pages. You can have separate controls for all states or have a separate control for one state and rely on the Forums control for the rest. It’s all up to you, depending on what custom content you want.



Article Comments

Martin Braithwaite, 5/7/2008
Let's say your site will only ever have one forum - is it possible to bypass the Forum List screen and go directly to the Single Forum screen?

Allison Hendricks, 7/4/2008
Hmmm is the advice to add in the script manager out of date? (it seems to already be in there): Also, this is a question from a totally non-technical person. Does this mean that I do not have to create all those extra pages for a single forum > single thread > edit post? Does sitefinit do it automatically once I create a page for the forums and the forums themselved in the forums module? Your article sounds like it should do it automatically, but when I tried it I get an error that the page is not found when I preview the live site. Help!

Telerik Admin, 7/11/2008
Hi Allison, The advice to add a script manager is not outdated, it is valid for any templates created by customers from scratch. We have already put it in the templates we ship with Sitefinity, so maybe this is why you see it. As for automatic creation of pages - if you're using the separate controls, you have to create them. If you're using the Forums control, you only have to create one page, as described in the article. Please if you have other issues on this, open a support ticket or write in the forums. Best regards, Slavo The Telerik team


Please Sign In to rate this article or to add it to your favorites.