Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How to add tags value in tags datatype programmatically in umbraco 9
if (articles != null && articles.Any() && blog != null) { foreach (var articleItem in articles) { IContent newArticle = _contentService.Create(articleItem.Title, blog.Id, "article"); newArticle.SetValue("title", articleItem.Title); newArticle.ParentId = blog.Id; newArticle.SetValue("subTitle", articleItem.SubTitle); newArticle.SetValue("shortSubTitle", articleItem.ShortSubTitle); newArticle.SetValue("image", articleItem.ImageUrl); newArticle.SetValue("imageAlt", articleItem.ImageAlt); newArticle.SetValue("linkTitle", articleItem.LinkTitle); newArticle.SetValue("articleUrl", articleItem.ArticleUrl); newArticle.SetValue("fecha", Convert.ToDateTime(articleItem.PublicationDate)); newArticle.AssignTags("tags", articleItem.Taxonomies.ToArray<string>(), false, "default"); _contentService.SaveAndPublish(newArticle); } }
newArticle.AssignTags statement doesn't work in my example
Any help please?
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to add tags value in tags datatype programmatically in umbraco 9
How to add tags value in tags datatype programmatically in umbraco 9
newArticle.AssignTags statement doesn't work in my example
Any help please?
Thanks
is working on a reply...