Sitefinity CMS

Modifying Blogs Send comments on this topic.
See Also
Developing with Sitefinity > Modules > Modules API > Generic Content Based Modules > Blogs > Blog Items > Modifying Blogs

Glossary Item Box

Updating a Blog is a very simple process:

  1. Get a Blog associated with a transaction
  2. Change its properties
  3. Save the Blog with BlogManager

Save a specified blog item:

SaveBlog(IBlog blog) Copy Code
// create new instance of BlogManager
Telerik.Blogs.BlogManager blogManager = new Telerik.Blogs.BlogManager();
// get all blogs
IList listOfAllBlogs = blogManager.GetBlogs();
if (listOfAllBlogs.Count > 0)
{
   
// get the first blog item
   
Telerik.Blogs.IBlog firstBlog = blogManager.GetBlog(((Telerik.Blogs.IBlog)listOfAllBlogs[0]).ID);
   
// change Name property of the blog item firstBlog
   
firstBlog.Name = "Changed Name of First Blog";
   
// save the item in the database
   
blogManager.SaveBlog(firstBlog);
   Response.Write(firstBlog.Name +
"<br />");
}

 

See Also