Sitefinity CMS

Modifying Forums Send comments on this topic.
See Also
Developing with Sitefinity > Modules > Modules API > Forums > Forum Items > Modifying Forums

Glossary Item Box

Updating forums is a very simple process:

  1. Find the forum to be updated
  2. Change its properties (that is, change the title of the forum)
  3. Save the forum
SaveForum(IForum forum) Copy Code
// create new instance of ForumManager
Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager();
// The GetForums(bool excludeHidden) method returns an object of type IList,
// so we create a list of all forums
IList listOfForums = forumManager.GetForums(false);
if (listOfForums.Count > 0)
{
   
// we get the ID of the first forum
   
Telerik.Forums.IForum firstForum = forumManager.GetForum(((Telerik.Forums.IForum)listOfForums[0]).ID);
   
// we change the Name property of the first forum
   
firstForum.Name = "First Forum - changed name!";
   
// finally we update the first forum
   
forumManager.SaveForum(firstForum);       
}


 

See Also