+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How can I create a new blog post and add tags?

How can I create a new blog post and add tags?

2 posts, 1 answered
  1. Bruno Michels
    Bruno Michels avatar
    125 posts
    Registered:
    16 Apr 2010
    13 Aug 2010
    Link to this post
    I'm trying to create a new blog post and add tags, but I don't know how to set tags for the IContent element.

    var blogManager = (new ContentManager("Blogs"));
    var post = blogManager.CreateContent("text/html");
     
    post.SetMetaData("Title", title.Text);
    post.Content = editor.Text;
     
    /* how can I set tags for the post ? */
     
    blog.Posts.Add(post);

    And do I have to use Manager.SaveContent on the post? Or how do I save it afterwards?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 Aug 2010
    Link to this post
    Hello Bruno Michels,

    You can take a look at Saves the given tags to the content item with specified ID:

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
2 posts, 1 answered