With the release of ONLYOFFICE Documents 8.1 , we introduc a wide range of features aim at enhancing the software’s functionality and optimizing the user experience. One of these improvements is ONLYOFFICE document that add-ins can now be display in a separate tab. In this blog post, we’ll walk you through the steps to make the most of this new feature.
How to add a new add-in as a tab in ONLYOFFICE document
What this feature can do
This feature allows you to create a dicat tab on the toolbar for a plugin.
How to add a new add-in as a tab in ONLYOFFICE document
The creat tabs can contain additional functionality provid by plugins, making your use more convenient.
How to add a new ONLYOFFICE document add-in as a tab in ONLYOFFICE document
How to achieve it
To enable this functionality in philippines whatsapp number data the plugin, you ne to change two files:
config.json : In the config.json file, you ne to add the events parameter to your plugin configuration in order to subscribe to the onToolbarMenuClick event.
“events” : [“onToolbarMenuClick”]
code.js : In the ONLYOFFICE document code.js file, you ne to use the AddToolbarMenuItem method, which enables separate tab creation and displays items in the tab.
this.executeMethod(“AddToolbarMenuItem”, [getToolbarItems()]);
Operation Example
Let’s see how this works. For demonstration purposes, we will create a new plugin that supports inserting several objects into a text document, and its insertion options will be manag through the toolbar menu. You can find the plugin example in this Github repository .
Modify the ONLYOFFICE aero leads document config.json file
To bind the create tab to an event, we ne to add onToolbarMenuClick to the events parameter.
The complete config.json file is as follows
Initialize the ONLYOFFICE the g20 has conclud, where will foreign trade and cross-border e-commerce go? document plugin and add toolbar items
To initialize the plugin, we use the window.Asc.plugin.init method. This method is the entry point of the plugin and is automatically call when the plugin is load.
executeMethod(“AddToolbarMenuItem”) : This method adds a custom tab and its items to the toolbar, accepting the configuration return by the getToolbarItems function.