Copied to clipboard

Flag this post as spam?

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


  • James 10 posts 101 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 299 posts 1182 karma points MVP c-trib
    Jun 14, 2019 @ 00:16
    Søren Gregersen
    100

    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 60 posts 134 karma points
    6 days ago
    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 299 posts 1182 karma points MVP c-trib
    6 days ago
    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 10 posts 101 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