Copied to clipboard

Flag this post as spam?

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


  • Mark Bowser 261 posts 846 karma points c-trib
    Jan 23, 2017 @ 16:00
    Mark Bowser
    0

    Convert Umbraco.UploadField to Umbraco.MediaPicker

    Umbraco v7.2.8

    We have inherited a website that doesn't use any Media Pickers. They use Umbraco.UploadFields everywhere. This means that their content editors are uploading the same image over and over in a lot of cases. The site has been around for a while and there are hundreds if not thousands of media items uploaded to the site this way. To further complicate things, the website has somehow worked itself into a situation where many of these content nodes have Upload fields that reference media files in the same folder. That means that if you delete one of the content nodes and empty the recycle bin, the media folder is deleted also. Other content nodes that link to media in that folder will all of a sudden have broken links.

    Does anyone have any advice for switching this site from using the Umbraco.UploadField to a Media Picker or an ImageCropper or something of that nature? The difficulty I'm having with any sort of automated process is creating a good media folder structure for the new media items and dealing with Umbraco.UploadFields that link to the same media item. Any thoughts?

    Thanks

  • Rasmus Eeg 87 posts 445 karma points c-trib
    Jan 26, 2017 @ 06:47
    Rasmus Eeg
    0

    Hi Mark,

    I would create a custom media picker, simply reuse the source of the current media picker controller. Then in the controller try parse the model.value to number, if failed, it should be a string.

    You could take it a step further and create a custom propertyconverter.

    Best of luck!

Please Sign in or register to post replies

Write your reply to:

Draft