Copied to clipboard

Flag this post as spam?

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


  • James 23 posts 156 karma points
    Jun 13, 2019 @ 22:38
    James
    0

    Opening Infinity Editor with Angular

    Is there a way in Umbraco 8 to open an infinity editor with angular to edit a page?

    I've tried this:

     var options = {
            title: "My custom infinite editor",
            view: "/umbraco#/content/content/edit/1063",
            submit: function (model) {
                editorService.close();
            },
            close: function () {
                editorService.close();
            }
        };
        editorService.open(options); 
    

    but it just opens a blank blade.

    Thanks.

    James R.

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Jun 14, 2019 @ 00:16
    Søren Gregersen
    102

    Hi,

    From reading the code comments (https://github.com/umbraco/Umbraco-CMS/blob/3bf5160895a2b551929f1830a9e40bc5b1fe1801/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js#L330), I get this:

    var options = {
        id: "content-id",
        submit: function(){ /* submit function */ },
        close: function(){ /* close function */ },
    };
    editorService.contentEditor(options);
    

    An examle can be found in contentpicker (https://github.com/umbraco/Umbraco-CMS/blob/c6467b355d6a5c0b10e2c79efbef8029d9cfac23/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js#L288)

    hth :)

  • Marco Teodoro 74 posts 149 karma points c-trib
    Sep 14, 2019 @ 17:42
    Marco Teodoro
    1

    Hi Soren this is cool but what if you want to make this on a custom angular section? For instance, i click on button to add a new customer and inside the first editor dialog i want to open another one to create the customer category. So not using Umbraco nodes but instead custom data from a custom api source.

    Do you know how to achieve this behavior?

    Thanks, Marco

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Sep 14, 2019 @ 20:17
    Søren Gregersen
    0

    Hi,

    Have a look at the source code of the code mentioned above. Essentially you have to create a view that can handle editing your entity.

    What umbraco does is that the entity (document) is composed of properties that are setup using datatypes and their editors.

    HTH :-)

  • James 23 posts 156 karma points
    Jun 14, 2019 @ 04:11
    James
    0

    Wow that works and its super cool!

    Thanks man!

Please Sign in or register to post replies

Write your reply to:

Draft