I am not sure if this is possible and haven't been able to get it to work yet.
I will be importing several 'Artist' content items that sit in a specific tree hierarchy in the content section. These 'Artist' content items contain upload fields for images which I would like stored in the media section in a matching tree hierarchy. For example if I have Home - Label name - New artist added to the content section I would like any images referenced against upload property fields for the artist to appear in the media sectoin under Artist media - Label name - New artist. The reason for this is there will potentionally be over a thousand 'Artist' document types, subdivided under serveral 'Label' document types, and therefore several thousand images so it will be easier to maintain if the media section layout reflects the content tree layout.
I have tried this by storing the images to import in the folder structure in the root that reflects the layout I want and referencing them using a relative path in the import excel spreadsheet (e.g. /Artist media/Label name/Artist name/logo.jpg) but this hasn't worked. The upload field values just reflect the relative path specified on the spreadsheet and nothing is imported into the media section.
Is there something I am missing or am I being overly optimistic with the CMSImport functionality? For reference I am using a licensed pro version. I am hoping there is some way that CMSImport can take care of this without me having to write an event to build and save the media items.
If you are using upload fields the image will not appear in the media section. It will import the images into Umbraco and assign it directly to the upload field. If you need want these images to appear in the media section you need to use a media picker. It will respect the folder structure on disk so make sure you have your folder structure on disk the same as you want it to be in the media section.
Thanks for the clarification Richard. I think the CMSImport Pro User manual needs to be amended as it states for Upload fields (part 5.3):
When an image (could also be a file) reference is mapped against an upload field. CMSImport will store the image in the Umbraco Media folder and update the reference in the Upload field.
The image afterwards also implies that the image files will be imported into the media section.
I'm reluctant to moan about this as CMSImport works very well but this was a feature we were hoping to get along with Excel support from our license and it is a bit disappointing that we now have to handle this through the event API.
Sorry to hear that. With media folder in the manual I meant media folder on disk. I will add that to the manual. Think it's best to update the upload field to media picker (if possible) and use that to map the media items. Then it will respect the folder structure from disk.
If it is all not possible I can help you with the event handler with some helper functions from cmsimport
I think it's the image of the media section under the text which causes the confusion as it implies it should be available there.
I'll look into the possibility of changing these properties to media pickers although I am not too sure if this will be possible. I have hacked together some code to do this in an event handler. I may send you an email to your 'info' address in your profile just to verify the code I have written and see if it could be changed to make use of any CMSImport helper functions if that is ok?
Importing media into a specified tree structure
I am not sure if this is possible and haven't been able to get it to work yet.
I will be importing several 'Artist' content items that sit in a specific tree hierarchy in the content section. These 'Artist' content items contain upload fields for images which I would like stored in the media section in a matching tree hierarchy. For example if I have Home - Label name - New artist added to the content section I would like any images referenced against upload property fields for the artist to appear in the media sectoin under Artist media - Label name - New artist. The reason for this is there will potentionally be over a thousand 'Artist' document types, subdivided under serveral 'Label' document types, and therefore several thousand images so it will be easier to maintain if the media section layout reflects the content tree layout.
I have tried this by storing the images to import in the folder structure in the root that reflects the layout I want and referencing them using a relative path in the import excel spreadsheet (e.g. /Artist media/Label name/Artist name/logo.jpg) but this hasn't worked. The upload field values just reflect the relative path specified on the spreadsheet and nothing is imported into the media section.
Is there something I am missing or am I being overly optimistic with the CMSImport functionality? For reference I am using a licensed pro version. I am hoping there is some way that CMSImport can take care of this without me having to write an event to build and save the media items.
Hi Andy,
If you are using upload fields the image will not appear in the media section. It will import the images into Umbraco and assign it directly to the upload field. If you need want these images to appear in the media section you need to use a media picker. It will respect the folder structure on disk so make sure you have your folder structure on disk the same as you want it to be in the media section.
Does that make sense?
Cheers,
Richard
Thanks for the clarification Richard. I think the CMSImport Pro User manual needs to be amended as it states for Upload fields (part 5.3):
When an image (could also be a file) reference is mapped against an upload field. CMSImport will store the image in the Umbraco Media folder and update the reference in the Upload field.The image afterwards also implies that the image files will be imported into the media section.
I'm reluctant to moan about this as CMSImport works very well but this was a feature we were hoping to get along with Excel support from our license and it is a bit disappointing that we now have to handle this through the event API.
Hi Andy,
Sorry to hear that. With media folder in the manual I meant media folder on disk. I will add that to the manual. Think it's best to update the upload field to media picker (if possible) and use that to map the media items. Then it will respect the folder structure from disk.
If it is all not possible I can help you with the event handler with some helper functions from cmsimport
Cheers,
Richard
I think it's the image of the media section under the text which causes the confusion as it implies it should be available there.
I'll look into the possibility of changing these properties to media pickers although I am not too sure if this will be possible. I have hacked together some code to do this in an event handler. I may send you an email to your 'info' address in your profile just to verify the code I have written and see if it could be changed to make use of any CMSImport helper functions if that is ok?
Thanks again for the help.
HI Andy,
Yes sure send me the code (richard [at]soetemansoftware[.]nl) I'll inlcude the helper code for you.
Cheers,
Richard
is working on a reply...