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.
You can read more about the mediaRessource and mediaTypeRessource services from the documentation at github found here http://umbraco.github.io/Belle/#/api
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"
}
]
}
}
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.
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...
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?
Hi Tom,
Ooops I have misunderstood the question so I removed my answer, sorry for that Tom.
/Dennis
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
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
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?
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
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
I think that really should be it.
Hope this helps!
/Jan
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.
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...
is working on a reply...