---
title: "How to Overwrite the Save & Publish button and more in Umbraco V14 — Hack Make Do"
description: "Overwrite the Save and Publish button in the Umbraco 14+ backoffice with your own workspace action, in this example one that plays a sound and shows confetti."
url: https://hackmakedo.com/blog/how-to-overwrite-the-save-publish-button-and-more-in-umbraco-v14/
---

# How to Overwrite the Save & Publish button and more in Umbraco V14

12 July 2024

- [Tutorials](https://hackmakedo.com/blog/topic/tutorials/)
- [Bellissima](https://hackmakedo.com/blog/topic/bellissima/)

With Umbraco V14+ and the new updated WebComponent based extensible backoffice, we have the power and flexibility to override and swap out existing functionality with our own.

For this example I will show how we can update the Save and Publish button on a content node with own implementation. For this we will replace the button so that when the user clicks the save and publish button that it will play a sound display some confetti 🎊

## Here is what we are building

[Video (video)](https://www.youtube.com/watch?v=Y6pHPU8NxpU)

## Just show me the code

### Manifest

```javascript
import { UMB_ENTITY_IS_NOT_TRASHED_CONDITION_ALIAS } from '@umbraco-cms/backoffice/recycle-bin';
import type { ManifestWorkspaceActions } from '@umbraco-cms/backoffice/extension-registry';

export const manifests: Array<ManifestWorkspaceActions> = [
	{
		type: 'workspaceAction',
        kind: 'default',
        overwrites: 'Umb.WorkspaceAction.Document.SaveAndPublish', // Alias of thing you want to overwrite
        alias: 'Tada.WorkspaceAction.Document.SaveAndPublish',
        name: '[Tada] SaManifestve And Publish Document Workspace Action',
        api: () => import('./tada.save-and-publish.action.js'), // Our implementation
        weight: 70,
        meta: {
            look: 'primary',
            color: 'positive',
            label: 'Awesome Save & Publish' // Update the text of the button
        },
        conditions: [
            {
                alias: 'Umb.Condition.WorkspaceAlias',
                match: 'Umb.Workspace.Document',  // Only show for Document workspace
            },
            {
                alias: UMB_ENTITY_IS_NOT_TRASHED_CONDITION_ALIAS, // Ensure the item is not in trash
            },
        ]
	},	
];
```

#### Workspace Action

```javascript
import { UMB_DOCUMENT_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/document';
import { UmbWorkspaceActionBase } from '@umbraco-cms/backoffice/workspace';
import { launchConfetti } from '../Confetti';

export default class TadaDocumentSaveAndPublishWorkspaceAction extends UmbWorkspaceActionBase {

    async execute() {
        try {
             // Get the workspace context
            const workspaceContext = await this.getContext(UMB_DOCUMENT_WORKSPACE_CONTEXT);

            // Load in drumroll
            const audio = new Audio('https://hackmakedo.com/audio/drumroll.mp3');

            // Define a flag to ensure the specific code runs only once
            let codeExecuted = false;

            audio.addEventListener('timeupdate', async () => {
                console.log('Current time:', audio.currentTime);

                // Check if the current time is at least 5 seconds and the specific code hasn't run yet
                if (audio.currentTime >= 1.5 && !codeExecuted) {
                     // Save and publish the document
		            await workspaceContext.saveAndPublish();

                    // Confetti time
                    launchConfetti();
    
                    // Ensure the code doesn't run again
                    // As the timeupdate event is fired lots as sfx  plays
                    codeExecuted = true;
                }
            });

            // Play the drumroll
            audio.play();
        }
        catch (error) {
            console.error('Failed to save and publish document', error);
        }
    }
}
```

> So the key thing to learn here is that by specifying the alias of the extension you want to overwrite as a the overwrites property in the new extension manifest.

### A quick note

Currently there is a small bug/issue with replacing the Save & Publish button as this then removes the child popver menu items such as Unpublish, Schedule Publish etc…

The[ issue has been reported on GitHub](https://github.com/umbraco/Umbraco-CMS/issues/16700) and has been acknowledged as a reproducible bug by Umbraco HQ.

## Want to take a further look

Well if you want to take a look at the source code, you can view the GitHub repository or if you prefer you can install it in your Umbraco site 🎉

[GitHub Repo](https://github.com/warrenbuckley/Tada) [MarketPlace](https://marketplace.umbraco.com/package/umbraco.community.tada)

### **Go have fun, experiment and see what you can replace**

_Confetti time !_ ([GIF ↗](https://giphy.com/embed/s2qXK8wAvkHTO))

## Keep reading

28 April 2025

### [Using SignalR, IOptionsMonitor with Umbraco Bellissima for reactive .NET Options](https://hackmakedo.com/blog/using-signalr-ioptionsmonitor-with-umbraco-bellissima-for-reactive-net-options/)

Combine IOptionsMonitor with a SignalR hub in an Umbraco 14+ package, so changing a .NET option switches features on or off in the backoffice with no redeploy.

[Bellissima](https://hackmakedo.com/blog/topic/bellissima/) · [.NET](https://hackmakedo.com/blog/topic/dotnet/) · [Tutorials](https://hackmakedo.com/blog/topic/tutorials/)

16 January 2025

### [How to refresh the Umbraco V14+ Bellissima content tree with code](https://hackmakedo.com/blog/how-to-refresh-the-umbraco-v14-bellissima-content-tree-with-code/)

Refresh the Umbraco 14+ content tree from your own code, so newly imported or synced content nodes show up straight away.

[Tutorials](https://hackmakedo.com/blog/topic/tutorials/) · [Bellissima](https://hackmakedo.com/blog/topic/bellissima/)

Need a hand with Umbraco Bellissima? I'm available as a freelancer or contractor.

[Get in touch](https://hackmakedo.com/contact/)
