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
Hi Team,
I have configured Parent child relationship between Datatypes in umbraco using Multinode Content picker.
Now I want to append more relationship in backend. Can you please help to guide me how i can achive this.
using (var cref = _umbracoContextFactory.EnsureUmbracoContext()) { var categoryContent = _contentService.GetById(new Guid("8e138bc7-d38c-4508-a5fb-ed48b701f6c0")); IPublishedContent publishedContent = cref.UmbracoContext.Content.GetById(new Guid("8e138bc7-d38c-4508-a5fb-ed48b701f6c0")); var storeContent = _contentService.GetById(new Guid("a5dd1ea8-01ae-44c0-9cd8-42fe3929f890")); var categoryProperty = storeContent.Properties.Where(x => x.Alias.ToLower() == "categories").FirstOrDefault(); var cateValues=categoryProperty?.GetValue("en-us"); storeContent.SetValue("categories", categoryContent.Key,"en-us"); _contentService.SaveAndPublish(storeContent); }
I am using ContentService but not able to add content.
Hi,
storeContent.SetValue("categories", categoryContent.Key,"en-us");
You need to convert your key (Guid) into Udi: https://our.umbraco.com/documentation/reference/querying/Udi
Thanks Andrey for this help
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to append already Published content to MulltiNode Content Picker in V9
Hi Team,
I have configured Parent child relationship between Datatypes in umbraco using Multinode Content picker.
Now I want to append more relationship in backend. Can you please help to guide me how i can achive this.
I am using ContentService but not able to add content.
Hi,
You need to convert your key (Guid) into Udi: https://our.umbraco.com/documentation/reference/querying/Udi
Thanks Andrey for this help
is working on a reply...