diff --git a/packages/cms/src/studio/document-options/document-options.ts b/packages/cms/src/studio/document-options/document-options.ts index bc3d4bfaee..c1c31e6be3 100644 --- a/packages/cms/src/studio/document-options/document-options.ts +++ b/packages/cms/src/studio/document-options/document-options.ts @@ -4,9 +4,16 @@ import { PublishOrAcceptAction } from './custom-actions/publish-or-accept'; // Removes lokalize from the global "create new" interface at the top left of the navigation bar. export const newDocumentOptions = (prev: TemplateResponse[], { creationContext }: { creationContext: NewDocumentCreationContext }) => { - if (creationContext.type === 'global' || creationContext.type === 'structure') { + if (creationContext.type === 'structure') { return prev.filter((templateItem) => templateItem.templateId !== 'lokalizeText'); } + if (creationContext.type === 'global') { + // Removes the button visually from the header + + window.document.querySelector('style')?.append('[data-ui="Navbar"] button[aria-label^="Create new document"] {display: none}'); + // Removes the functionality from the button in the header + return []; + } return prev; };