Customize Collabora CODE Toolbars Without Editing Source

To simplify the Collabora Online Development Edition (CODE) editor, choose Compact or Tabbed for the overall layout, then use the WOPI host’s PostMessage integration to hide individual commands, buttons, or Notebookbar tabs. Collapsing a toolbar is a convenient viewing change; hiding a control through the host is more appropriate when you want a consistent interface for each editing session.

Which CODE interface should you customize?

CODE offers a Compact layout with traditional menus and toolbars, and a Tabbed layout with a Notebookbar. Start by identifying which one your users see: a toolbar button ID and a Notebookbar tab ID are not interchangeable. Collabora’s support guidance says the older names classic and notebookbar were deprecated in favor of compact and tabbed starting with the 21.11 series. See the Collabora interface configuration guidance.

Collabora CODE Tabbed interface with File, Home, Insert, Layout, View and Help tabs above a Writer document.
The Tabbed layout groups editing tools under named tabs; the Help tab is a possible target for Hide_NotebookTab.
Collabora CODE Compact interface showing the File, Edit, View, Insert, Format, Tools and Help menus above a narrow toolbar.
The Compact layout uses a separate menu row and smaller button strip, so menu and button controls need different identifiers.

Should you change a server default or a user session?

Change the server default only when most users should begin with the same layout. On self-managed installations, the user_interface.mode setting in coolwsd.xml accepts default, compact, or tabbed. Back up the configuration, then change the existing mode value rather than adding another XML element:

<user_interface>
  <mode>tabbed</mode>
</user_interface>

This abbreviated XML demonstrates the setting, not a replacement for the whole configuration section. Apply the change through your deployment’s normal configuration and service-restart process, then reopen a document. Container deployments may instead pass --o:user_interface.mode=tabbed in their existing CODE startup overrides. An embedding application can also influence the starting mode through its WOPI ui_defaults value. The host’s preference can matter when the server uses default, so do not assume a server edit will override an integration-specific choice.

Can you hide an entire toolbar without editing CODE source?

For more space while reading, clicking the currently selected tab can collapse the Notebookbar; clicking again expands it. Collabora describes this behavior in its official Notebookbar introduction. The PostMessage API also documents Collapse_Notebookbar, which hides Notebookbar buttons or the Compact button strip. It is a reversible display state, not a permanent administrator policy.

For finer control, choose the PostMessage action that matches the element. The following mappings are listed in the Collabora Online SDK manual:

What to hidePostMessage actionID format
One toolbar buttonHide_ButtonButton ID
A command across menus and toolbarsHide_CommandUNO command, such as .uno:ThemeDialog
One tab in the Tabbed layoutHide_NotebookTabTab ID, such as Help
A Compact menu entryHide_Menu_ItemMenu item ID

The tab-specific action is documented beginning in 24.04.11.1. The SDK also notes expanded contextual-menu coverage for Hide_Command in 24.04.11.2. Check your deployed CODE build before relying on either behavior.

How do you send the hide commands from the WOPI host?

These actions are sent by the application embedding CODE in an iframe—not typed into a CODE settings dialog. You need control of that host integration, a functioning WOPI CheckFileInfo response, and a PostMessageOrigin value that matches your host web application’s origin. If you use a packaged Nextcloud or ownCloud integration, it may not expose arbitrary custom PostMessage hooks; in that case make the change in the integration itself or use its supported settings.

1. Wait for CODE to finish loading

Register a message listener in the host page. Verify both the sender window and origin. When CODE reports App_LoadingStatus with Status: Document_Loaded, send Host_PostmessageReady before the customization messages. Without that handshake, CODE can ignore host commands—a failure explained in Collabora issue #13224.

2. Hide a tab and a formatting command

The following host-side JavaScript assumes your page already has an iframe with ID collabora-frame. Set editorOrigin to the exact HTTPS origin serving your CODE editor, not the WOPI storage server. Register the listener before document initialization in your real application:

const frame = document.getElementById('collabora-frame');
const editorOrigin = 'https://office.example.com';

function sendToCode(MessageId, Values = {}) {
  frame.contentWindow.postMessage(JSON.stringify({
    MessageId, SendTime: Date.now(), Values
  }), editorOrigin);
}

window.addEventListener('message', (event) => {
  if (event.source !== frame.contentWindow ||
      event.origin !== editorOrigin) return;
  let message;
  try {
    message = typeof event.data === 'string'
      ? JSON.parse(event.data) : event.data;
  } catch { return; }
  if (message?.MessageId !== 'App_LoadingStatus' ||
      message?.Values?.Status !== 'Document_Loaded') return;

  sendToCode('Host_PostmessageReady');
  sendToCode('Hide_NotebookTab', { id: 'Help' });
  sendToCode('Hide_Command', { id: '.uno:ThemeDialog' });
});
Browser developer tools Sources panel showing a host-side message listener and a Hide_NotebookTab call targeting Help.
The host application’s source panel is where postMessage wiring can be inspected. Use the complete code sample in the article, not the abbreviated text shown in this panel.

Here Help is the Notebookbar tab target, while .uno:ThemeDialog identifies a LibreOffice UNO command. Collabora developers specifically describe the latter ID in their guidance on hiding UNO elements. To hide a specific Compact toolbar button instead, replace the action with Hide_Button and supply the verified button ID. Do not guess the ID from the visible caption; check your installed CODE source or the SDK’s toolbar ID guidance.

What if the tab or toolbar does not disappear?

Check the browser console and network activity before changing CODE files. The most common causes are an absent Host_PostmessageReady handshake, a mismatched PostMessageOrigin, sending messages before Document_Loaded, or targeting a Compact menu item while the editor is in Tabbed mode. Reopening the file starts a new session, so apply the hide messages each time.

Version-specific defects also exist. For example, Collabora issue #15910 describes a Hide_NotebookTab JavaScript error on CODE 25.04.9.4, reported in June 2026; the issue is marked closed, but that alone does not establish which deployed builds contain a fix. Check your exact version and its release notes if you see the reported error.

Finally, hiding is not access control. A hidden Print or Download button may leave equivalent APIs or other paths available. If the goal is to prohibit those operations, use the documented WOPI DisablePrint or DisableExport flags and enforce your storage permissions as appropriate, rather than relying on Hide_Button or Hide_Command.

How can you verify that customization worked?

Open a fresh document in the intended layout. Confirm that the Help tab is absent in Tabbed mode and that the Theme command is no longer offered where it was previously visible. Then edit and save a test document to confirm that normal authoring still works. Repeat the check with another document type and after reloading the page, because the host must reapply session-specific hide commands.

Collabora CODE Tabbed interface with File, Home, Insert, Layout and View tabs, with Help removed and a Writer document remaining editable.
After the Help tab is hidden, the other editing tabs and document canvas remain available for a functional check.

Leave a Comment

Customize Collabora CODE Toolbars Without Editing Source

Customize Collabora CODE Toolbars Without Editing Source

Simplify Collabora CODE with Compact or Tabbed mode and WOPI PostMessage controls to hide selected buttons, commands, and tabs safely.

Run Collabora CODE Behind Nginx with TLS Termination

Run Collabora CODE Behind Nginx with TLS Termination

Put Nginx in charge of HTTPS for a Collabora CODE container, forward editing WebSockets correctly, and verify the public endpoint without exposing port 9980.

Keep Text Visible When the Collabora Mobile Keyboard Opens

Keep Text Visible When the Collabora Mobile Keyboard Opens

Troubleshoot a mobile browser keyboard covering text in Collabora Online, with quick workarounds and separate checks for browsers, embedded WebViews, and host pages.

Stop Unwanted Printing and Downloads in ONLYOFFICE

Stop Unwanted Printing and Downloads in ONLYOFFICE

Set print and download limits for ONLYOFFICE links, room members, or Docs API sessions, then verify the restrictions from a recipient account.

Schedule Reliable Backups for ONLYOFFICE Workspace

Schedule Reliable Backups for ONLYOFFICE Workspace

Set a backup destination, schedule, Mail coverage, and retention limit in ONLYOFFICE Workspace, then verify the archive is ready to restore.

Deploy ONLYOFFICE Docs Enterprise with Its Official Compose File

Deploy ONLYOFFICE Docs Enterprise with Its Official Compose File

Start the Enterprise Docker Compose stack, persist its license and data, configure JWT safely, and confirm the editors are ready to integrate.

Clean Spreadsheet Text with a Reusable ONLYOFFICE Macro

Clean Spreadsheet Text with a Reusable ONLYOFFICE Macro

Use an ONLYOFFICE JavaScript macro to remove nonprinting characters and trim extra spaces from a defined spreadsheet range, with a safe review workflow.

Sync Active Directory Users with ONLYOFFICE DocSpace via LDAP

Sync Active Directory Users with ONLYOFFICE DocSpace via LDAP

Connect ONLYOFFICE DocSpace to Active Directory or OpenLDAP, import users and groups safely, map account fields, and schedule reliable synchronization.

Change ONLYOFFICE Workspace’s Default Storage Location

Change ONLYOFFICE Workspace’s Default Storage Location

Move portal data from Disk Default to a supported cloud storage provider, or relocate Docker data safely by changing its host volume mapping.

Completely Remove ONLYOFFICE Document Server from Linux

Completely Remove ONLYOFFICE Document Server from Linux

Identify whether Document Server uses a Linux package or Docker, remove only its components, and check remaining data without deleting shared services by mistake.