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:
User clicks on "Save and Publish".
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.
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?
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?
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:
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?
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?
is working on a reply...