Nested Content and the Grid + Block editor require that you write a FieldProvider or Advanced settings provider for that field. It's so special that you can't create a generic fieldmapper for that.
Section 9.3 and 9.4 of the Manual describe how you can implement these providers.
What happens when my destination Umbraco 8 site has multiple Data Types defined using Nested Content?
For example, let's say I have these two data types:
Banner Ad Picker (Nested Content) consisting of element types: Banner Ad. The document type Banner Ad (alias: bannerAd) has these fields:
Label (alias: label) Textstring
Title (alias: title) Textstring
Image (alias: image) Image Picker (based on Media Picker)
Link (alias: link) URL Picker (based on Multi URL Picker)
Gallery Images Picker (Nested Content) consisting of element types: Gallery Image. The document type Gallery Image (alias: galleryImage) has these fields:
Title (alias: title) Textstring
By Line (alias: byLine) Textstring
Image (alias: image) Image Picker (based on Media Picker)
Photo Credit (alias: photoCredit) Textstring
Body Content (alias: bodyContent) Rich Text Editors
Both of these Data Types have this Property Editor Alias: Umbraco.NestedContent
Let's say I'm importing some articles and mapping them to a Document Type Article (alias: article) which has a property Gallery Images (alias: galleryImages). The galleryImages property uses the Gallery Images Picker data type. During the import my custom FieldProvider is selected to map the Gallery Images data but how is it to know whether the destination data type is Banner Ad Picker or Gallery Images Picker? They're both Umbraco.NestedContent.
I'm guessing the property mapping that is done as part of the import process ... where I say field X in my source is mapped to galleryImages of document type article in the CMS ... is part of the ImportPropertyInfo or FieldProviderOptions params passed into Parse()?
Import data into nested content
I've purchased CMS Import Pro and like to able to use SQL or CSV to import data into a nested content
How would I able to let's say create Furniture with Cabinet Material Finish of Red?
They'll be more characteristics at later date.
Hi Paul,
Nested Content and the Grid + Block editor require that you write a FieldProvider or Advanced settings provider for that field. It's so special that you can't create a generic fieldmapper for that.
Section 9.3 and 9.4 of the Manual describe how you can implement these providers.
Hope this helps.
Best,
Richard
Got it working using FieldProvider, thank you.
For anyone else in a similar position to me, you just need serialise the nested content like:
You'll need to split the string on how you see fit to loop through the nested content or whatever requirements you need. Hopefully helpful to someone.
Thanks for Sharing Paul!
What happens when my destination Umbraco 8 site has multiple Data Types defined using Nested Content?
For example, let's say I have these two data types:
Both of these Data Types have this Property Editor Alias: Umbraco.NestedContent
Let's say I'm importing some articles and mapping them to a Document Type Article (alias: article) which has a property Gallery Images (alias: galleryImages). The galleryImages property uses the Gallery Images Picker data type. During the import my custom FieldProvider is selected to map the Gallery Images data but how is it to know whether the destination data type is Banner Ad Picker or Gallery Images Picker? They're both Umbraco.NestedContent.
I'm guessing the property mapping that is done as part of the import process ... where I say field X in my source is mapped to galleryImages of document type article in the CMS ... is part of the ImportPropertyInfo or FieldProviderOptions params passed into Parse()?
Hi Chester,
You get the PropertyEditorAlias of the property in your FieldProvider and act on that.
If you inject IMediaImport on the constructor of the FieldProvider you can use
This will import the media as well.
Hope this helps,
Richard
Thank you. I'll give it a try!
is working on a reply...