Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • andy_rose 91 posts 117 karma points
    Sep 07, 2011 @ 16:54
    andy_rose
    0

    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.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 07, 2011 @ 19:29
    Richard Soeteman
    0

    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

  • andy_rose 91 posts 117 karma points
    Sep 08, 2011 @ 08:59
    andy_rose
    0

    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.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 08, 2011 @ 12:33
    Richard Soeteman
    0

    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

  • andy_rose 91 posts 117 karma points
    Sep 08, 2011 @ 13:01
    andy_rose
    0

    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.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Sep 08, 2011 @ 14:27
    Richard Soeteman
    0

    HI Andy,

    Yes sure send me the code (richard [at]soetemansoftware[.]nl) I'll inlcude the helper code for you.

    Cheers,

    Richard

     

Please Sign in or register to post replies

Write your reply to:

Draft