How to Create NestedContent Item In SurfaceController
Hello Everyone
I am new to Umbraco. The document type has a named "Parent" which is a Nested Content data type that contains a list of "Child" document type without template. I am trying to add child items dynamically (in a Surface Controller) to parent. Can you please suggest me.
Not sure if this helps, but in our site we synchronise products from another sytsem, so this is what we do to add the products(child items) to the shop (parent)
var newproduct= contentService.Create("this product", parentid, "product");
you can then set properties for newproduct using
newproduct.SetValue("attributename",value);
and the finally do
contentService.SaveAndPublish(product);
Hi Reddick, Thank you for your response. It's working when adding child to parent but actually I am trying to add value to nested content property programmatically in document type page. I am having a bit of trouble getting it working fully.
How to Create NestedContent Item In SurfaceController
Hello Everyone
I am new to Umbraco. The document type has a named "Parent" which is a Nested Content data type that contains a list of "Child" document type without template. I am trying to add child items dynamically (in a Surface Controller) to parent. Can you please suggest me.
Not sure if this helps, but in our site we synchronise products from another sytsem, so this is what we do to add the products(child items) to the shop (parent)
Hi Reddick, Thank you for your response. It's working when adding child to parent but actually I am trying to add value to nested content property programmatically in document type page. I am having a bit of trouble getting it working fully.
is working on a reply...