Copied to clipboard

Flag this post as spam?

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


  • Olof Landahl 3 posts 24 karma points
    Sep 11, 2014 @ 12:08
    Olof Landahl
    0

    Custom editors in grid (Umbraco 7.2)

    The available editors in the grid seems to be rich text, media, macro, embed, headline and quote.

    I want to add a custom property editor to that list. Is this possible, without changing the source code?

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Sep 11, 2014 @ 12:31
    Dennis Aaen
    0

    Hi Olof and welcome to Our.

    Try to see this session from this year's Codegarden, Per is talking about the grid, and how you can configure it.

    The talk about the grid starts at 27 min ish

    http://stream.umbraco.org/video/9961032/thinking-in-seven

    Hope this helps you a bit further,

    /Dennis

  • Olof Landahl 3 posts 24 karma points
    Sep 15, 2014 @ 16:11
    Olof Landahl
    1

    Thanks for the fast response Dennis!

    I managed to get it working. Here's what I did:

    • Add a property editor in App_Plugins, but make sure you use 'control.value' as model and not 'model.value' (which will refer to the grid scope) in your controller.
    • The package.manifest only has to specify the javascript(s) for your editor plugin.
    • Add the configuration for the editor in Config/grid.editors.config.js. Make sure your view path points to the html view in App_Plugins, relative to the Umbraco folder (../App_Plugins/'wherever your view is')
    • Add a cshtml template in Views/Partials/Grid/Editors
  • keilo 568 posts 1023 karma points
    Nov 30, 2014 @ 03:59
    keilo
    0

    Hi Olof

    Can you share the complete solution (App_Plugins\xx folder) from which others can learn with beginner knowledge on angular and the grid?

    That would be much appreciated.

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 11:03
    Haris
    0

    I have the same problem, and still haven't figured out how to make them visible in the backoffice.

    For some time I've been searching the forum and found couple of interesting links but at the end I haven't made it work. I'm trying to extend the Fanoe starter kit which already has custom editor properties. I think that I'm stuck around the part with the package.manifest, since I added the view, also the render cshtml in the app_plugin folder.

    It would be very useful for me If you could please share your example or elaborate more on how to add custom grid editors.

    Greetings

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Dec 15, 2014 @ 11:18
    Dave Woestenborghs
    0

    To make your editor available you need to edit to the grid.editors.config.js file which can be found in the config folder and make sure that is set as allowed editor on your datatype;

    You can that information in the documentation in the section build your own editor : http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors-v7/Grid-Layout

    Dave

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 11:25
    Haris
    0

    Dave,

    thanks for a quick reply. I've already tried to add my editor in the grid.editors.config.js file but I cant set it to be allowed on my datatype because it's missing. I can't see it after adding it on the grid.editors.config.js file.

    Greetings

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Dec 15, 2014 @ 11:40
    Dave Woestenborghs
    1

    That's probably due to caching. If you open the page with chrome developer tools and disable cache you can see it.

    Another option is to update the client dependency cache.

    Go to config/ClientDependency.config and search for the version attribute. Increment this and reload your page.

    dave

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 11:52
    Haris
    0

    When I disable caching, none of the editor properties are shown. Also it doesn't work with the ClientDependency.config version increment :/

    Any other suggestions?

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Dec 15, 2014 @ 11:57
    Steve Morgan
    1

    Sounds like you have an error in your grid.controllers.config.js file - check the commas especiallly!

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Dec 15, 2014 @ 11:58
    Dave Woestenborghs
    0

    Can you post your editors config file ? Maybe there is a error in there ?

    Dave

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 12:19
    Haris
    0

    Steve I don't have the grid.controllers.config.js file only the grid.editors.config.js

    And in the editors config file, almost everything's the same as it came with the Fanoe starter kit, except I added between these two parts    

       {
            "name": "Image wide",
            "alias": "media_wide",
            "view": "media",
            "render": "/App_Plugins/Grid/Editors/Render/media_wide.cshtml",
            "icon": "icon-picture"
        },
        {
            "name": "Image wide 2",
            "alias": "media_wide2",
            "view": "media",
            "render": "/App_Plugins/Grid/Editors/Render/media_wide2.cshtml",
            "icon": "icon-picture"
        },
        {
            "name": "Image wide cropped",
            "alias": "media_wide_cropped",
            "view": "media",
            "render": "media",
            "icon": "icon-picture",
            "config": {
                "size": {
                    "width": 1920,
                    "height": 700
                }
            }
        },

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Dec 15, 2014 @ 12:39
    Dave Woestenborghs
    0

    This looks correct. So it still looks to me like a browser or a clientdependency caching issue.

    dave

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 13:30
    Haris
    0

    Dave thanks again for your help, but still it's not working.

    Do you by anychance have an example project with these custom grid editors which you could send to me?

    Haris

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Dec 15, 2014 @ 14:09
    Steve Morgan
    0

    Sorry before - I did mean the grid.editors.config.js  - just check there isn't a comma after the final closing brace. Also - is there anything in the error console of the dev tools when Umbraco tries to load the editors?

    Patrick has an example download as a link at the very bottom of this thread: http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/59563-Tutorial-on-creating-custom-grid-editors?p=0  This works and is a handy content picker example (though not feature complete). 

     

     

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 14:40
    Haris
    0

    Downloaded the files from your link, copied them to my project and deleted files inside clientdependecy folder, also incremented the version inside config/clientdependency.config started my app and still the same... :/

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Dec 15, 2014 @ 15:07
    Steve Morgan
    0

    Any errors in the dev tools?

  • Haris 15 posts 35 karma points
    Dec 15, 2014 @ 17:47
    Haris
    0

    Heey people

    Somehow it's working now :) I'm not sure how exactly, I kept doing the same thing over and over (incrementing the ClientDependency and deleting the cache) and somehow it sudenly started to work as it supposed to :D Normaly I wouldn't be satisfied with such and answer but after I spent so much time on this I'm just glad it's working. Probably I'll figure it out some other time.

     

    Once again, thanks to all you guys who were helping me out :)

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Dec 15, 2014 @ 18:44
    Steve Morgan
    0

    I've found something around the need to touch the webconfig, restart and then re-save the data type and republish pages that have the grid on it for some changes to come through. Perhaps that explains it?!

  • schlubadub 102 posts 617 karma points
    Mar 05, 2015 @ 07:06
    schlubadub
    0

    @Steve - yep, I had the same issue as you and found the only consistent way to push through changes to the grid (and associated changes to views or renders) was to touch the web.config file as you said

Please Sign in or register to post replies

Write your reply to:

Draft