Copied to clipboard

Flag this post as spam?

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


  • Tom 120 posts 448 karma points
    Mar 20, 2014 @ 14:29
    Tom
    0

    Media picker in property editor

    I'm making a property editor to select various styles for the header.

    I want the user to be able to pick a background image and set its position ect.

    Can I use the build-in media picker inside my property editor? And how?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 20, 2014 @ 21:38
    Dennis Aaen
    0

    Hi Tom,

    Ooops I have misunderstood the question so I removed my answer, sorry for that Tom.

    /Dennis

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 20, 2014 @ 21:43
    Jan Skovgaard
    0

    Hi Tom

    If you want to use the media picker in your own property editor it's actually described in this workbook on property editors from the cogworks. http://belle-lab.thecogworks.co.uk/assets/belle-workbook.pdf - It's step3: that goes over how this is done.

    Hope this helps.

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 20, 2014 @ 21:46
    Jan Skovgaard
    0

    Hello again

    You can read more about the mediaRessource and mediaTypeRessource services from the documentation at github found here http://umbraco.github.io/Belle/#/api

    /Jan

  • Tom 120 posts 448 karma points
    Mar 21, 2014 @ 13:48
    Tom
    0

    thanks jan, great resources. I'll dig into them.

    A side question: Can I use the build-in "media picker" directly in my own property editor?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 21, 2014 @ 14:01
    Jan Skovgaard
    0

    Hi Tom

    I have not gotten my hands dirty on this subject yet mysfelf but in short. Yes I believe so, by using the services from the documentation I linked.

    Looking forward to hear if you succeed :)

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 21, 2014 @ 16:35
    Jan Skovgaard
    0

    Hi Tom

    As I'm currently playing around with a property editor myself I stumpled over a blog post by Tim Geyssens, where he mentions the default views that can be used on your fields.

    In your Umbraco installation go to /umbraco/views/prevalueeditors/ - In here you can see all the default options for your field type. As you can see there is a type called "mediapicker.hmtl", which I think is the one you're after.

    So for instance if you want to add a prevalue field for media picker you could do it like this

      prevalues: {
        fields:[
          {
            label: "Media",
            description: "Select an image from the media picker",
            key: "media",
            view: "mediapicker"
          }
        ]
      }
     }
    

    I think that really should be it.

    Hope this helps!

    /Jan

  • Tom 120 posts 448 karma points
    Mar 21, 2014 @ 22:32
    Tom
    0

    Thanks again, Jan.

    The prevalues though, are for parameters used to setup the prop editor. What I'm looking for is using the existing build-in prop editors inside a custom editor. I need the end-user to be able to pick a image via the Media Picker and also set some repeat and position options in the one and same prop editor. It's mostly to save some space and not having to use three different prop editors.

  • Tom 120 posts 448 karma points
    Mar 21, 2014 @ 23:36
    Tom
    100

    I finally managed to call dialogService.mediaPicker and get the media picker dialog. Guess I have to do all the html and css myself then. I hoped it was possible to use the build-in stuff for that - but this will work...

Please Sign in or register to post replies

Write your reply to:

Draft