Copied to clipboard

Flag this post as spam?

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


  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jan 12, 2015 @ 18:35
    Jesper Ordrup
    0

    Using the grid media dialog

    Hi all,

    The new grid that is used in the "Fanoe" template uses a media picker which also supports focus and crop. This seems great as I assume it lets the user define a crop on a per use basis.

    My question is - how do I use it from my own property editor? Or Grid editor? Any code around?

    best
    Jesper

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 12, 2015 @ 18:43
    Dennis Aaen
    1

    Hi Jesper,

    Perhaps, this post can help you further http://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/55678-How-to-reuse-an-Umbraco-Property-Editor-from-dialogService

    Try also too see this workbook about make your own property editor. https://github.com/umbraco/AngularWorkbook I assume that you have seen the documentation about the grid layout http://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout. There are also videos on Umbraco TV about the grid layout. http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/grid-layouts/introduction/

    Hope this helps,

    /Dennis

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 12, 2015 @ 19:13
    Dennis Aaen
    0

    And Jesper if you go to this /Umbraco/Views/propertyeditors/grid/editors location of your Umbraco installation you can find a file called media.html.

    /Dennis

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jan 13, 2015 @ 08:50
    Jesper Ordrup
    0

    Thanks for the pointers Dennis!

    I found the code needed for adding focalpoint which is used by media picker in the grid in umbraco.controllers.js

    The bit that I needed was the extra options to the mediaPicker:

     dialogService.mediaPicker({
          startNodeId: $scope.control.editor.config && $scope.control.editor.config.startNodeId ? $scope.control.editor.config.startNodeId : undefined,
                    multiPicker: false,
                    cropSize:  $scope.control.editor.config && $scope.control.editor.config.size ? $scope.control.editor.config.size : undefined,
                    showDetails: true,
                    callback: function (data) {
                        $scope.control.value = {
                            focalPoint: data.focalPoint,
                            id: data.id,
                            image: data.image
                       };
                        $scope.setUrl();
                    }
                });

     

    This enables me to do all I need. 

    Can anyone tell me where to find some docs on the mediaPicker options? I can only find something in the belle documentation which only covers a few options.

    best
    Jesper 

     

Please Sign in or register to post replies

Write your reply to:

Draft