Assigning tags to news articles when importing

David Pearson asked on February 17, 2015 21:00

How do assign tags to news articles when I import into Kentico 8.X. Here is my code I use to import.

//importArticle is the article to be imported. TreeNode parentNode = tree.SelectSingleNode(SiteContext.CurrentSiteName, "/Design-Ideas", "en-us"); if (parentNode != null) { TreeNode newNode = TreeNode.New("CMS.News", tree); newNode.DocumentCulture = "en-us"; newNode.SetIntegerValue("NewsId", importArticle.IntNewsId, false); newNode.SetValue("NewsTitle", importArticle.Title); newNode.SetValue("NewsReleaseDate", importArticle.PubDate); newNode.SetValue("NewsSummary", importArticle.Summary); newNode.SetValue("NewsText", importArticle.Content); newNode.SetValue("DocumentPublishFrom", importArticle.PubDate); DateTime pubDate = Convert.ToDateTime(importArticle.PubDate); newNode.SetValue("DocumentPublishTo", pubDate.AddYears(1).ToString());

    newNode.Tags ??????????????????????????????


     //Insert the node into the tree under Design-Ideas
  newNode.Insert(parentNode);
    }

Thanks for any input. David

Recent Answers


Brenden Kehren answered on February 20, 2015 13:49

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.