Extending the current publish / publish screen

I have a requirement when I need to show a warning / popup when the editor clicks on the Unpublish menu command. I will show a popup with a Yes / No button, if Yes is selected, we will continue and show the existing UnPub screen. If “No” is selected, no action occurs and the user returns to the screen.

  • How can this be achieved?

  • Can we expand / redefine an existing CME team without creating a new team for ourselves?

+4
source share
1 answer

I just learned how to do this yesterday (thanks to Nuno Linhares) - you need to first get acquainted with the new editor for the GUI.

The next step is to find the name of the command you want to overwrite (perhaps "UnPublish" in your case). The easiest way to do this is to use the "check item" using Chrome or FieFox in the GUI and look for something like c:command="UnPublish" on the button you want to extend.

After you set up the basic editor, you need to add a new command to overwrite the existing one, for example:

 <extensions> <ext:dataextenders /> <ext:editorextensions> <ext:editorextension target="CME"> <ext:editurls /> <ext:listdefinitions /> <ext:taskbars /> <ext:commands /> <ext:commandextensions> <ext:commands> <ext:command name="UnPublish" extendingcommand="CustomUnPublishCommand"/> </ext:commands> <ext:dependencies> <cfg:dependency>CustomUnPublish.CommandSet</cfg:dependency> </ext:dependencies> </ext:commandextensions> <ext:contextmenus /> <ext:lists /> <ext:tabpages /> <ext:toolbars /> <ext:ribbontoolbars /> </ext:editorextension> </ext:editorextensions> </extensions> 

Add all your dependencies (JS and CSS, etc.) and command links in the usual way.

Then write down your JS execution function in the same way as any other GUI command, and call the existing command after you have processed your popup, something like this:

 CustomUnPublish.prototype._execute = function CustomUnPublish$_execute(selection, pipeline) { //Insert some logic to make a popup and confirm blnOkToProceed = true; // if (blnOkToProceed) { //EDIT: Original code $cme.getCommand("UnPublish")._execute(selection, pipeline); //EDIT: Or using the suggestion from @Peter below $commands.executeCommand("UnPublish", selection, pipeline); //End Edit } return; }; 
+8
source

All Articles