Copied to clipboard

Flag this post as spam?

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


  • Breakfast 5 posts 76 karma points
    Jan 18, 2016 @ 17:51
    Breakfast
    0

    Open a dialogue in certain contexts when an item is published from the BackOffice in Umbraco 7?

    With certain types of record, I need to share them to another service ( with a customisable message ) when they are published. What I want to do is along the following lines:

    1. User clicks on "Save and Publish".
    2. If the record has not been published to External Service, an interface element pops up with a box that the user can use to customise the message and a "send" button.
    3. When the "send" button is clicked, the item is shared with the provided message.

    What is the best way to fit this into the Umbraco BackOffice?

    Most of the resources I can find talk about using OpenModalWindow fired from the ContentService.SentToPublish event, but they mostly seem quite old- is that still the recommended approach? If so how do I find the correct location for the Angular page to open in that window?

    The call I need to make in order to publish to the external service is available through a REST API so I could do this entirely from Javascript,; if I am to do that, what is the best way to ensure my code is included in the edit pages for the relevant document types? Do I need to create a custom datatype that doesn't actually map to any field on the record? Or am I missing an entirely different way to make my code available when I am editing these records?

  • Breakfast 5 posts 76 karma points
    Jan 19, 2016 @ 12:25
    Breakfast
    0

    The old OpenModalWindow approach certainly doesn't appear to work in 7.x so I'm trying to do things in JavaScript.

    I have got to a point where I am able to use an app_plugin to drop JavaScript in the page. What I would really like to be able to do is just hook into the behaviour of the Angular controller for editing pages, as that would give me a lot of the information I need upfront, but that doesn't appear to be available to me - I can either completely overwrite the controller or I can't seem to touch it.

    I can use JQuery to drop an extra event listener on the "Save And Publish" button but it feels like a very dirty hack and I would much prefer to do something that fits better with the Umbraco way of doing things. Any suggestions?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies