Copied to clipboard

Flag this post as spam?

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


  • Cory Colt 34 posts 130 karma points
    Jul 12, 2017 @ 16:52
    Cory Colt
    0

    Custom Grid Editor for Image and Text

    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!

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jul 12, 2017 @ 17:03
    Dennis Aaen
    0

    Hi Cory,

    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.

    /Dennis

  • Cory Colt 34 posts 130 karma points
    Jul 12, 2017 @ 17:08
    Cory Colt
    0

    Dennis,

    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?

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jul 12, 2017 @ 17:15
    Dennis Aaen
    0

    Hi Cory,

    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.

    Best,

    /Dennis

  • Phil Atkinson 51 posts 244 karma points
    Jul 13, 2017 @ 07:31
    Phil Atkinson
    0

    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()

  • Brian McNally 13 posts 91 karma points
    May 23, 2018 @ 18:57
    Brian McNally
    0

    Hi Cory, Looking to do the EXACT same thing, just curious how this went for you.

  • Amir Khan 1282 posts 2739 karma points
    May 23, 2018 @ 23:13
    Amir Khan
    0

    Hi Cory,

    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.

    LeBlender: https://our.umbraco.org/projects/backoffice-extensions/leblender/

    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.

    -Amir

  • David Peck 687 posts 1863 karma points c-trib
    May 24, 2018 @ 08:53
    David Peck
    0

    You can call the dialog service's mediaPicker method on a button click: https://our.umbraco.org/apidocs/ui/#/api/umbraco.services.dialogService

Please Sign in or register to post replies

Write your reply to:

Draft