I need to add a button (next to publish button) or in the actions menu of the edit document page in the back end that performs a publish along with site syncing that document ("Publish and Sync"). I have the code to work the the FluentAPI and sync the document through SIteSync, but I am confused on how to add the button/link and perform the action.
I believe I found how to add the button/link in the back end (please see screenshot attached), but need to know exactly how it should be setup so it displays the button or link, and so I can perform the appropriate action when it is clicked.
Any help would be appreciated. Thanks.
To add additional button in the actions menu, you can use this article:
Then in the service you can use the SiteSync API to schedule sync for the document.
Please try this and get back to us if you have any problems with it.
Hi Bonny, thanks for the response.
We were told by Sitefinity Support that Documents is the one content type that cannot have an action added to it in the Document List grid in the back end; so I don't think that solution will work for Documents. Is that true?
Additionally, while it would be great to also have the ability to add a link to the actions on the grid view, the client also wants to be able to add a button on the edit document screen next to the Publish and Save as Draft buttons. Is there a guide on how to be able to add an additional button to this section? (in the screenshot in my original post)
Here are the steps you need to follow:
1. Using this article to extend the default media content workflow called "AnyMediaContentApprovalWorkflow.xamlx" and using the workflow editor in ContentApproval->Default add new decision activity called "Sync" with command name "sync" (you can just copy and paste the preview activity). Check out this video.
2. When you go to the edit screen you will see an additional button called "Sync". Now we need to handle the command from this button. I have prepared the script that handles it - you can use it:
Register the script in Settings>Advanced>Libraries>Controls>DucumentsBackend>Views>DocumentsBackendEdit>Scripts. Remember to set the "Name of the load method" to "OnDetailViewLoaded".
The workflow modification will display the "Sync" button and the script will handle it. You can create a service that you can call to publish and sync the item.
Please tell me if there are any problems with this approach.