Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I don't know if what I'm trying to do is even possible and I can't find any sort of documentation verifying if it is possible or not.
What I'm trying to do -- create a custom grid editor to allow for a user to select an image and give it a title and description. Is this even possible or am I misunderstanding the point of custom grid editors?
Right now I've created a custom editor and it's displaying a textbox for the title and a textarea for the description, but I'm not sure how to allow the user to select an image... Any help would be greatly appreciated!
Perhaps this documentation can help you in the right direction. https://our.umbraco.org/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Grid-Layout/build-your-own-editor
Also we are shipping Grid editor that allows you to pick an image via a media picker.
So perhaps you could also get inspirtation from this grid editor.
We also have a video chapter about this subject https://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/grid-layouts/ but it requires that you have a subscription for Umbraco TV
Hope this can help you.
Thank you for your quick reply. I've read through the first link you sent and this is actually what I followed to get my grid editor working to where it's at right now, but I'm missing the ability to have the user select an image. If I change the view to be "media" then it will use the default media view instead of my own which contains two additional text boxes.
My thought was I'd create this custom editor so a user can just select an image and enter a title and description and be done. Is this possible or am I just going about this wrong?
Yes that should be possible. Perhaps you could have a look of what we are doing on the grid editor called Media, and the combine it with the code that you have right now.
you need to look at the default MediaPickerController and the mediapicker.html files and create your own based on that.
you will see the click event and the call to setImage()
Hi Cory, Looking to do the EXACT same thing, just curious how this went for you.
In addition to the comments above, you may want to take a look at these two packages that will help you achieve what you want without having to code your own editor.
You'll still have to write a partial to render it but it these will take care of the back office stuff for you.
Doc type grid editor: https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor/
We use one of these on any project where we're using the grid.
You can call the dialog service's mediaPicker method on a button click:
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted